Moved welcomeFileHashes to localSettings
This commit is contained in:
parent
abd0890512
commit
801c344c6c
@ -1,4 +1,5 @@
|
||||
export default () => ({
|
||||
welcomeFileHashes: {},
|
||||
showNavigationBar: true,
|
||||
showEditor: true,
|
||||
showSidePreview: true,
|
||||
|
@ -327,10 +327,13 @@ localDbSvc.sync()
|
||||
|
||||
// Save welcome file content hash if not done already
|
||||
const hash = utils.hash(welcomeFile);
|
||||
const welcomeFileHashes = store.getters['data/welcomeFileHashes'];
|
||||
const welcomeFileHashes = store.getters['data/localSettings'].welcomeFileHashes;
|
||||
if (!welcomeFileHashes[hash]) {
|
||||
store.dispatch('data/patchWelcomeFileHashes', {
|
||||
store.dispatch('data/patchLocalSettings', {
|
||||
welcomeFileHashes: {
|
||||
...welcomeFileHashes,
|
||||
[hash]: 1,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -157,7 +157,7 @@ function syncFile(fileId, syncContext = new SyncContext()) {
|
||||
const isWelcomeFile = () => {
|
||||
const file = getFile();
|
||||
const content = getContent();
|
||||
const welcomeFileHashes = store.getters['data/welcomeFileHashes'];
|
||||
const welcomeFileHashes = store.getters['data/localSettings'].welcomeFileHashes;
|
||||
const hash = content ? utils.hash(content.text) : 0;
|
||||
return file.name === 'Welcome file' && welcomeFileHashes[hash];
|
||||
};
|
||||
|
@ -211,10 +211,6 @@ module.actions.setSyncData = setter('syncData');
|
||||
module.getters.dataSyncData = getter('dataSyncData');
|
||||
module.actions.patchDataSyncData = patcher('dataSyncData');
|
||||
|
||||
// Welcome file content hashes (used as a file sync blacklist)
|
||||
module.getters.welcomeFileHashes = getter('welcomeFileHashes');
|
||||
module.actions.patchWelcomeFileHashes = patcher('welcomeFileHashes');
|
||||
|
||||
// Tokens
|
||||
module.getters.tokens = getter('tokens');
|
||||
module.getters.googleTokens = (state, getters) => getters.tokens.google || {};
|
||||
|
Loading…
Reference in New Issue
Block a user