-
-
Notifications
You must be signed in to change notification settings - Fork 45
Fix/data migrations #840
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix/data migrations #840
Changes from all commits
850c86a
adba26f
ac390b2
0fffc9c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -110,13 +110,13 @@ class BaseNoteModel(private val app: Application) : AndroidViewModel(app) { | |
|
|
||
| lateinit var selectedExportMimeType: ExportMimeType | ||
|
|
||
| lateinit var labels: LiveData<List<String>> | ||
| lateinit var reminders: LiveData<List<NoteReminder>> | ||
| private var allNotes: LiveData<List<BaseNote>>? = null | ||
| var labels: LiveData<List<String>> = NotNullLiveData(mutableListOf()) | ||
| var reminders: LiveData<List<NoteReminder>> = NotNullLiveData(mutableListOf()) | ||
| private var allNotes: LiveData<List<BaseNote>>? = NotNullLiveData(mutableListOf()) | ||
| private var allNotesObserver: Observer<List<BaseNote>>? = null | ||
| var baseNotes: Content? = null | ||
| var deletedNotes: Content? = null | ||
| var archivedNotes: Content? = null | ||
| var baseNotes: Content? = Content(MutableLiveData(), ::transform) | ||
| var deletedNotes: Content? = Content(MutableLiveData(), ::transform) | ||
| var archivedNotes: Content? = Content(MutableLiveData(), ::transform) | ||
|
|
||
| val folder = NotNullLiveData(Folder.NOTES) | ||
|
|
||
|
|
@@ -149,7 +149,7 @@ class BaseNoteModel(private val app: Application) : AndroidViewModel(app) { | |
| internal var showRefreshBackupsFolderAfterThemeChange = false | ||
| private var labelsHiddenObserver: Observer<Set<String>>? = null | ||
|
|
||
| init { | ||
| fun startObserving() { | ||
| NotallyDatabase.getDatabase(app).observeForever(::init) | ||
| folder.observeForever { newFolder -> | ||
| searchResults!!.fetch(keyword, newFolder, currentLabel) | ||
|
|
@@ -166,7 +166,7 @@ class BaseNoteModel(private val app: Application) : AndroidViewModel(app) { | |
| // colors = baseNoteDao.getAllColorsAsync() | ||
| reminders = baseNoteDao.getAllRemindersAsync() | ||
|
|
||
| allNotes?.removeObserver(allNotesObserver!!) | ||
| allNotesObserver?.let { allNotes?.removeObserver(it) } | ||
| allNotesObserver = Observer { list -> Cache.list = list } | ||
| allNotes = baseNoteDao.getAllAsync() | ||
| allNotes!!.observeForever(allNotesObserver!!) | ||
|
|
@@ -897,7 +897,7 @@ class BaseNoteModel(private val app: Application) : AndroidViewModel(app) { | |
| askForUriPermissions(backupFolderUri) | ||
| } | ||
| .show() | ||
| } catch (e: Exception) { | ||
| } catch (_: Exception) { | ||
| showRefreshBackupsFolderAfterThemeChange = false | ||
| disableBackups() | ||
| } | ||
|
Comment on lines
+900
to
903
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Check for Kotlin version declarations in gradle files and version catalogs
echo "=== Searching for Kotlin version in gradle files ==="
fd -e toml -e gradle -e "gradle.kts" | xargs grep -i "kotlin" 2>/dev/null | grep -iE "version|kotlin-version|kotlinVersion|kotlin-gradle-plugin" | head -40Repository: Crustack/NotallyX Length of output: 288 🏁 Script executed: #!/bin/bash
# More comprehensive search for all Kotlin version configurations
echo "=== All Kotlin version-related declarations ==="
rg -i "kotlin.*version|version.*kotlin" --type gradle --type toml -A 2 -B 2 | head -60Repository: Crustack/NotallyX Length of output: 274 🏁 Script executed: #!/bin/bash
# Broader search for Kotlin version
echo "=== All references to Kotlin 1.9 and 2.0 ==="
rg -i "kotlin.*1\.9|1\.9.*kotlin|kotlin.*2\.0|2\.0.*kotlin" | head -20
echo ""
echo "=== Content of main build files ==="
for file in build.gradle.kts app/build.gradle.kts gradle/libs.versions.toml; do
if [ -f "$file" ]; then
echo "File: $file"
cat "$file" | grep -i "kotlin\|version" | head -15
echo ""
fi
doneRepository: Crustack/NotallyX Length of output: 1295 Use of The discard syntax for exception parameters ( 🤖 Prompt for AI Agents |
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.