Skip to content

Update: Clear tracks data when logging out #3269

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

Merged
merged 3 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [v2.23.0]

### Fixes

- Properly clear analytics cookies on logout [#3269](https://github.com/Automattic/simplenote-electron/pull/3269)

## [v2.22.2]

### Enhancements
Expand Down
12 changes: 1 addition & 11 deletions lib/boot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,11 @@ const clearStorage = (): Promise<void> =>
localStorage.removeItem('localQueue:note');
localStorage.removeItem('localQueue:preferences');
localStorage.removeItem('localQueue:tag');
localStorage.removeItem('simpleNote');
localStorage.removeItem('stored_user');
sessionStorage.clear();
window.electron?.send('appStateUpdate', {});

const settings = localStorage.getItem('simpleNote');
if (settings) {
try {
const { accountName, ...otherSettings } = JSON.parse(settings);
localStorage.setItem('simpleNote', JSON.stringify(otherSettings));
} catch (e) {
// pass - we only care if we can successfully do this,
// not if we fail to do it
}
}

Promise.all([
new Promise((resolve) => {
const r = indexedDB.deleteDatabase('ghost');
Expand Down
1 change: 1 addition & 0 deletions lib/state/analytics/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ export const middleware: S.Middleware = (store) => {
break;
case 'LOGOUT':
record('user_signed_out');
analytics.clearedIdentity();
break;
case 'OPEN_NOTE':
record('list_note_opened');
Expand Down