Skip to content

Commit

Permalink
fix mobile/android notes not showing until refresh/change mode
Browse files Browse the repository at this point in the history
  • Loading branch information
0xGingi committed Nov 15, 2024
1 parent 7ab4f64 commit 0b5d29b
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 15 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion android/app/src/main/assets/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<link rel="manifest" href="/site.webmanifest"> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Trusty Notes</title>
<script defer data-domain="notes.toolworks.dev" src="https://plausible.toolworks.dev/js/script.js"></script>
<script type="module" crossorigin src="/assets/index-DhE_q3AR.js"></script>
<script type="module" crossorigin src="/assets/index-B1frYiu1.js"></script>
<link rel="modulepreload" crossorigin href="/assets/buffer-Cq5fL-tY.js">
<link rel="stylesheet" crossorigin href="/assets/index-BHNR0Rya.css">
</head>
Expand Down
12 changes: 7 additions & 5 deletions android/capacitor-cordova-android-plugins/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.7.2'
classpath 'com.android.tools.build:gradle:8.2.1'
}
}

Expand All @@ -19,16 +19,18 @@ android {
namespace "capacitor.cordova.android.plugins"
compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34
defaultConfig {
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34
versionCode 1
versionName "1.0"
}
lintOptions {
abortOnError false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
lint {
abortOnError false
}
}

repositories {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN
ext {
cdvMinSdkVersion = project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23
cdvMinSdkVersion = project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
// Plugin gradle extensions can append to this to have code run at the end.
cdvPluginPostBuildExtras = []
cordovaConfig = [:]
Expand Down
3 changes: 2 additions & 1 deletion src/components/RichTextEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,14 @@ export function RichTextEditor({ content, onChange }: RichTextEditorProps) {
editorProps: {
attributes: {
class: 'rich-text-editor',
style: 'height: 100%'
},
},
});

useEffect(() => {
if (editor && content !== editor.getHTML()) {
editor.commands.setContent(content);
editor.commands.setContent(content, false);
}
}, [content, editor]);

Expand Down
22 changes: 21 additions & 1 deletion src/styles/mobile.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
padding-top: var(--ion-safe-area-top);
padding-bottom: var(--ion-safe-area-bottom);
background-color: var(--mantine-color-body);
height: 100vh;
overflow: hidden;
}

.keyboard-visible .markdown-editor {
max-height: calc(100vh - 270px);
}
Expand All @@ -23,6 +25,24 @@
overflow-x: hidden;
-webkit-text-size-adjust: 100%;
}

.android .ProseMirror {
min-height: 50vh;
height: calc(100vh - 200px);
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}

.android .rich-text-editor {
display: flex;
flex-direction: column;
height: calc(100vh - 120px);
}

.android .mantine-AppShell-main {
height: 100vh;
overflow: hidden;
}

.mantine-AppShell-main {
padding: 2px !important;
Expand Down

0 comments on commit 0b5d29b

Please sign in to comment.