Skip to content
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: migration redux persist #4431

Merged
merged 1 commit into from
Oct 31, 2023

Conversation

alter-eggo
Copy link
Contributor

@alter-eggo alter-eggo commented Oct 26, 2023

Try out this version of Leather — download extension builds.

Comment on lines 109 to 140
async function migrateToRenameKeysStoreModule() {
const storageVal = (await new Promise(resolve =>
chrome.storage.local.get(['persist:root'], resolve)
)) as any;
if (!storageVal) return undefined;
const store = storageVal['persist:root'];

if (store.keys) {
void analytics.track('redux_persist_migration_to_rename_keys_store_module');
return getStoredState(legacyKeysConfig);
}

return storage;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
async function migrateToRenameKeysStoreModule() {
const storageVal = (await new Promise(resolve =>
chrome.storage.local.get(['persist:root'], resolve)
)) as any;
if (!storageVal) return undefined;
const store = storageVal['persist:root'];
if (store.keys) {
void analytics.track('redux_persist_migration_to_rename_keys_store_module');
return getStoredState(legacyKeysConfig);
}
return storage;
}
async function migrateToRenameKeysStoreModule(state: any) {
if (state.keys.entities.default.type === 'ledger') {
// extract key info, migrate to --> state.ledger.stacks.entities/ids
const newLedgerStacksEntities = { entities: { } }
const newState = {}
}
return { ...state, softwareKeys: state.keys, ledger: { ...state.ledger, stacks: { ...newState } } }
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chrome.storage.local

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alter-eggo alter-eggo force-pushed the fix/migration-persist branch from dc94c60 to 3171116 Compare October 30, 2023 18:41
@alter-eggo alter-eggo force-pushed the fix/migration-persist branch from 3171116 to 86f2168 Compare October 31, 2023 11:05
@alter-eggo alter-eggo marked this pull request as ready for review October 31, 2023 11:06
@alter-eggo alter-eggo requested a review from kyranjamie October 31, 2023 11:06
@alter-eggo alter-eggo merged commit cf653c1 into refactor/stack-ledger-store Oct 31, 2023
19 checks passed
@alter-eggo alter-eggo deleted the fix/migration-persist branch October 31, 2023 11:12
@alter-eggo alter-eggo restored the fix/migration-persist branch October 31, 2023 11:12
@alter-eggo alter-eggo deleted the fix/migration-persist branch October 31, 2023 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants