Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3400355
D10277.id34456.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D10277.id34456.diff
View Options
diff --git a/web/redux/initial-state-gate.js b/web/redux/initial-state-gate.js
--- a/web/redux/initial-state-gate.js
+++ b/web/redux/initial-state-gate.js
@@ -8,7 +8,7 @@
import type { ThreadStoreOperation } from 'lib/ops/thread-store-ops.js';
import { allUpdatesCurrentAsOfSelector } from 'lib/selectors/keyserver-selectors.js';
import { canUseDatabaseOnWeb } from 'lib/shared/web-database.js';
-import type { LegacyRawThreadInfo } from 'lib/types/thread-types.js';
+import type { RawThreadInfo } from 'lib/types/thread-types.js';
import { convertIDToNewSchema } from 'lib/utils/migration-utils.js';
import { entries } from 'lib/utils/objects.js';
import { useDispatch } from 'lib/utils/redux-utils.js';
@@ -97,7 +97,7 @@
const threadStoreOperations: ThreadStoreOperation[] = entries(
threadInfos,
- ).map(([id, threadInfo]: [string, LegacyRawThreadInfo]) => ({
+ ).map(([id, threadInfo]: [string, RawThreadInfo]) => ({
type: 'replace',
payload: {
id,
diff --git a/web/redux/redux-setup.js b/web/redux/redux-setup.js
--- a/web/redux/redux-setup.js
+++ b/web/redux/redux-setup.js
@@ -295,19 +295,37 @@
state.threadStore.threadInfos[activeThread].currentUser.unread
) {
// Makes sure a currently focused thread is never unread
- updateActiveThreadOps.push({
- type: 'replace',
- payload: {
- id: activeThread,
- threadInfo: {
- ...state.threadStore.threadInfos[activeThread],
- currentUser: {
- ...state.threadStore.threadInfos[activeThread].currentUser,
- unread: false,
+ const activeThreadInfo = state.threadStore.threadInfos[activeThread];
+ // TODO (atul): Try to get rid of this ridiculous branching.
+ if (activeThreadInfo.minimallyEncoded) {
+ updateActiveThreadOps.push({
+ type: 'replace',
+ payload: {
+ id: activeThread,
+ threadInfo: {
+ ...activeThreadInfo,
+ currentUser: {
+ ...activeThreadInfo.currentUser,
+ unread: false,
+ },
},
},
- },
- });
+ });
+ } else {
+ updateActiveThreadOps.push({
+ type: 'replace',
+ payload: {
+ id: activeThread,
+ threadInfo: {
+ ...activeThreadInfo,
+ currentUser: {
+ ...activeThreadInfo.currentUser,
+ unread: false,
+ },
+ },
+ },
+ });
+ }
}
const oldActiveThread = activeThreadSelector(oldState);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 3, 7:04 AM (20 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2610740
Default Alt Text
D10277.id34456.diff (2 KB)
Attached To
Mode
D10277: [web] Update `validateStateAndProcessDBOperations` to handle `RawThreadInfos`
Attached
Detach File
Event Timeline
Log In to Comment