diff --git a/.husky/pre-commit b/.husky/pre-commit index 36af21989..869b4f5d5 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,11 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" +branch="$(git rev-parse --abbrev-ref HEAD)" + +if [ "$branch" = "main" ]; then + echo "You can't commit directly to main branch" + exit 1 +fi + npx lint-staged diff --git a/src/api/electronStore.ts b/src/api/electronStore.ts index 14297aa1b..b5ba5ea3e 100644 --- a/src/api/electronStore.ts +++ b/src/api/electronStore.ts @@ -3,12 +3,14 @@ import { safeStorageStore } from '../stores/safeStorage.store'; import { uploadStatusStore } from '../stores/upload.store'; import { logError } from '../services/logging'; import { userPreferencesStore } from '../stores/userPreferences.store'; +import { watchStore } from '../stores/watch.store'; export const clearElectronStore = () => { try { uploadStatusStore.clear(); keysStore.clear(); safeStorageStore.clear(); + watchStore.clear(); userPreferencesStore.delete('optOutOfCrashReports'); } catch (e) { logError(e, 'error while clearing electron store');