mirror of
https://github.com/PrimalHQ/primal-web-app.git
synced 2024-09-30 00:41:09 +00:00
Fix for settings reset
This commit is contained in:
parent
b415744936
commit
0ac94efb6a
@ -339,7 +339,8 @@ export const SettingsProvider = (props: { children: ContextChildren }) => {
|
||||
getDefaultSettings(subid)
|
||||
};
|
||||
|
||||
const loadSettings = (pubkey: string | undefined) => {
|
||||
const loadSettings = (pubkey: string | undefined, then?: () => void) => {
|
||||
|
||||
if (!pubkey) {
|
||||
return;
|
||||
}
|
||||
@ -439,6 +440,7 @@ export const SettingsProvider = (props: { children: ContextChildren }) => {
|
||||
|
||||
updateStore('defaultFeed', () => store.availableFeeds[0]);
|
||||
|
||||
then && then();
|
||||
unsub();
|
||||
return;
|
||||
});
|
||||
@ -516,6 +518,7 @@ export const SettingsProvider = (props: { children: ContextChildren }) => {
|
||||
// addAvailableFeed(trendingFeed, true, false);
|
||||
// }
|
||||
|
||||
loadSettings(publicKey, () => {
|
||||
const fwr = initFeeds?.find(f => f.hex === feedLatestWithReplies.hex && f.includeReplies === feedLatestWithReplies.includeReplies);
|
||||
|
||||
// Add active user's feed if it's missing
|
||||
@ -530,9 +533,7 @@ export const SettingsProvider = (props: { children: ContextChildren }) => {
|
||||
if (initFeeds && !initFeeds.find(f => f.hex === feedLatest.hex && f.includeReplies === feedLatest.includeReplies)) {
|
||||
addAvailableFeed(feedLatest, true, false);
|
||||
}
|
||||
setTimeout(() => {
|
||||
loadSettings(publicKey);
|
||||
}, 100);
|
||||
});
|
||||
});
|
||||
|
||||
createEffect(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user