Skip to content

Commit

Permalink
Move archiveReload to the root app as a shared function
Browse files Browse the repository at this point in the history
  • Loading branch information
GiovanH committed Aug 29, 2024
1 parent e06e0c0 commit 6f186df
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 18 deletions.
11 changes: 11 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,17 @@
webFrame.setZoomLevel(this.zoomLevel)
}
},
archiveReload() {
this.memoizedClearAll()
this.$root.loadState = "LOADING"
this.$nextTick(function () {
// Don't show loading screen, "soft" reload
// this.$root.loadState = "LOADING"
this.$localData.root.applySaveIfPending()
ipcRenderer.send('RELOAD_ARCHIVE_DATA')
})
},
openJumpbox() {
if (this.$localData.settings.showAddressBar) {
document.querySelector('#jumpBox input').select()
Expand Down
11 changes: 1 addition & 10 deletions src/components/AppMenu/TabBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -298,16 +298,7 @@ export default {
ipcRenderer.invoke('reload')
},
archiveReload(){
// Should match settings.archiveReload
this.memoizedClearAll()
this.$root.loadState = "LOADING"
this.$nextTick(function () {
// Don't show loading screen, "soft" reload
// this.$root.loadState = "LOADING"
this.$localData.root.applySaveIfPending()
ipcRenderer.send('RELOAD_ARCHIVE_DATA')
})
this.$root.app.archiveReload()
}
}
}
Expand Down
9 changes: 1 addition & 8 deletions src/components/SystemPages/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -826,15 +826,8 @@ export default {
},
archiveReload(){
this.debounce = false
this.memoizedClearAll()
this.$root.loadState = "LOADING"
this.$nextTick(function () {
// Don't show loading screen, "soft" reload
// this.$root.loadState = "LOADING"
this.$localData.root.applySaveIfPending()
ipcRenderer.send('RELOAD_ARCHIVE_DATA')
})
this.$root.app.archiveReload()
},
openSubModel: function(mod, info_only=false) {
this.$refs.modal.openMod(mod, info_only)
Expand Down

0 comments on commit 6f186df

Please sign in to comment.