Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b7c3cfd

Browse files
ui(pages): reflect permanent deletions on group and page titles
1 parent 93c9e55 commit b7c3cfd

File tree

3 files changed

+75
-0
lines changed

3 files changed

+75
-0
lines changed

‎apps/client/src/code/pages/computed/group-names.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,21 @@ export const groupNames = once(() =>
2626
return { status: 'success', text: 'Personal group' };
2727
}
2828

29+
const groupPermanentDeletionDate = internals.realtime.globalCtx.hget(
30+
'group',
31+
groupId,
32+
'permanent-deletion-date',
33+
);
34+
35+
if (
36+
groupPermanentDeletionDate != null &&
37+
groupPermanentDeletionDate < new Date()
38+
) {
39+
_getLogger.info(`${groupId}: Group is permanently deleted`);
40+
41+
return { status: 'unknown', text: `[Group ${groupId}]` };
42+
}
43+
2944
const [accessKeyring, groupEncryptedName] = await Promise.all([
3045
groupAccessKeyrings()(groupId!).getAsync(),
3146

‎apps/client/src/code/pages/computed/page-absolute-titles.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,50 @@ export const pageAbsoluteTitles = once(() =>
3030
'encrypted-absolute-title',
3131
);
3232

33+
const pagePermanentDeletionDate = internals.realtime.globalCtx.hget(
34+
'page',
35+
pageId,
36+
'permanent-deletion-date',
37+
);
38+
3339
const groupId = pageGroupIds()(pageId).get();
3440

41+
const groupPermanentDeletionDate = internals.realtime.globalCtx.hget(
42+
'group',
43+
groupId,
44+
'permanent-deletion-date',
45+
);
46+
3547
if (pageEncryptedAbsoluteTitle == null) {
3648
_getLogger.info(`${pageId}: No encrypted page title found`);
3749

3850
return { text: `[Page ${pageId}]`, status: 'unknown' };
3951
}
4052

53+
if (
54+
pagePermanentDeletionDate != null &&
55+
pagePermanentDeletionDate < new Date()
56+
) {
57+
_getLogger.info(`${pageId}: Page is permanently deleted`);
58+
59+
return { text: `[Page ${pageId}]`, status: 'unknown' };
60+
}
61+
4162
if (groupId == null) {
4263
mainLogger.info(`${pageId}: No group ID found`);
4364

4465
return { text: `[Page ${pageId}]`, status: 'unknown' };
4566
}
4667

68+
if (
69+
groupPermanentDeletionDate != null &&
70+
groupPermanentDeletionDate < new Date()
71+
) {
72+
_getLogger.info(`${pageId}: Group is permanently deleted`);
73+
74+
return { text: `[Page ${pageId}]`, status: 'unknown' };
75+
}
76+
4777
const pageKeyring = pageKeyrings()(`${groupId}:${pageId}`).get();
4878

4979
if (pageKeyring?.topLayer !== DataLayer.Raw) {

‎apps/client/src/code/pages/computed/page-relative-titles.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,50 @@ export const pageRelativeTitles = once(() =>
3030
'encrypted-relative-title',
3131
);
3232

33+
const pagePermanentDeletionDate = internals.realtime.globalCtx.hget(
34+
'page',
35+
pageId,
36+
'permanent-deletion-date',
37+
);
38+
3339
const groupId = pageGroupIds()(pageId).get();
3440

41+
const groupPermanentDeletionDate = internals.realtime.globalCtx.hget(
42+
'group',
43+
groupId,
44+
'permanent-deletion-date',
45+
);
46+
3547
if (pageEncryptedRelativeTitle == null) {
3648
_getLogger.info(`${pageId}: No encrypted page title found`);
3749

3850
return { text: `[Page ${pageId}]`, status: 'unknown' };
3951
}
4052

53+
if (
54+
pagePermanentDeletionDate != null &&
55+
pagePermanentDeletionDate < new Date()
56+
) {
57+
_getLogger.info(`${pageId}: Page is permanently deleted`);
58+
59+
return { text: `[Page ${pageId}]`, status: 'unknown' };
60+
}
61+
4162
if (groupId == null) {
4263
mainLogger.info(`${pageId}: No group ID found`);
4364

4465
return { text: `[Page ${pageId}]`, status: 'unknown' };
4566
}
4667

68+
if (
69+
groupPermanentDeletionDate != null &&
70+
groupPermanentDeletionDate < new Date()
71+
) {
72+
_getLogger.info(`${pageId}: Group is permanently deleted`);
73+
74+
return { text: `[Page ${pageId}]`, status: 'unknown' };
75+
}
76+
4777
const pageKeyring = pageKeyrings()(`${groupId}:${pageId}`).get();
4878

4979
if (pageKeyring?.topLayer !== DataLayer.Raw) {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /