mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-20 10:19:08 +00:00
Avoid incorrect use of preload cache
This commit is contained in:
@@ -1571,7 +1571,7 @@ export class ConversationModel {
|
|||||||
// The message is being sent before the user has scrolled down to load the newest
|
// The message is being sent before the user has scrolled down to load the newest
|
||||||
// messages into memory; in that case, we scroll the user all the way down by
|
// messages into memory; in that case, we scroll the user all the way down by
|
||||||
// loading the newest message
|
// loading the newest message
|
||||||
drop(this.loadNewestMessages(newestId, undefined));
|
drop(this.loadNewestMessages(message.id, undefined));
|
||||||
} else if (
|
} else if (
|
||||||
// The message has to be not a story or has to be a story reply in direct
|
// The message has to be not a story or has to be a story reply in direct
|
||||||
// conversation.
|
// conversation.
|
||||||
|
|||||||
@@ -294,12 +294,6 @@ const getModeSpecificProps = (
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function preloadConversation(conversationId: string): void {
|
|
||||||
drop(
|
|
||||||
window.ConversationController.get(conversationId)?.preloadNewestMessages()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
async function saveAlerts(alerts: ServerAlertsType): Promise<void> {
|
async function saveAlerts(alerts: ServerAlertsType): Promise<void> {
|
||||||
await itemStorage.put('serverAlerts', alerts);
|
await itemStorage.put('serverAlerts', alerts);
|
||||||
}
|
}
|
||||||
@@ -402,6 +396,19 @@ export const SmartLeftPane = memo(function SmartLeftPane({
|
|||||||
});
|
});
|
||||||
}, [changeLocation]);
|
}, [changeLocation]);
|
||||||
|
|
||||||
|
const maybePreloadConversation = useCallback(
|
||||||
|
(conversationId: string) => {
|
||||||
|
if (conversationId !== selectedConversationId) {
|
||||||
|
drop(
|
||||||
|
window.ConversationController.get(
|
||||||
|
conversationId
|
||||||
|
)?.preloadNewestMessages()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
[selectedConversationId]
|
||||||
|
);
|
||||||
|
|
||||||
let hasExpiredDialog = false;
|
let hasExpiredDialog = false;
|
||||||
let unsupportedOSDialogType: 'error' | 'warning' | undefined;
|
let unsupportedOSDialogType: 'error' | 'warning' | undefined;
|
||||||
if (hasAppExpired) {
|
if (hasAppExpired) {
|
||||||
@@ -469,7 +476,7 @@ export const SmartLeftPane = memo(function SmartLeftPane({
|
|||||||
otherTabsUnreadStats={otherTabsUnreadStats}
|
otherTabsUnreadStats={otherTabsUnreadStats}
|
||||||
pauseBackupMediaDownload={pauseBackupMediaDownload}
|
pauseBackupMediaDownload={pauseBackupMediaDownload}
|
||||||
preferredWidthFromStorage={preferredWidthFromStorage}
|
preferredWidthFromStorage={preferredWidthFromStorage}
|
||||||
preloadConversation={preloadConversation}
|
preloadConversation={maybePreloadConversation}
|
||||||
removeConversation={removeConversation}
|
removeConversation={removeConversation}
|
||||||
renderCaptchaDialog={renderCaptchaDialog}
|
renderCaptchaDialog={renderCaptchaDialog}
|
||||||
renderCrashReportDialog={renderCrashReportDialog}
|
renderCrashReportDialog={renderCrashReportDialog}
|
||||||
|
|||||||
Reference in New Issue
Block a user