diff --git a/app/mobile/src/session/conversation/Conversation.jsx b/app/mobile/src/session/conversation/Conversation.jsx
index 25a9f983..9f47573d 100644
--- a/app/mobile/src/session/conversation/Conversation.jsx
+++ b/app/mobile/src/session/conversation/Conversation.jsx
@@ -87,7 +87,9 @@ export function ConversationBody() {
{ state.topics.length === 0 && (
- No Messages
+ { state.init && (
+ No Messages
+ )}
)}
{ state.topics.length !== 0 && (
@@ -107,7 +109,7 @@ export function ConversationBody() {
keyExtractor={item => item.topicId}
/>
)}
- { !state.init && (
+ { !state.init && state.delayed && (
diff --git a/app/mobile/src/session/conversation/useConversation.hook.js b/app/mobile/src/session/conversation/useConversation.hook.js
index 856b33a5..216f3b3c 100644
--- a/app/mobile/src/session/conversation/useConversation.hook.js
+++ b/app/mobile/src/session/conversation/useConversation.hook.js
@@ -19,12 +19,15 @@ export function useConversation() {
editData: null,
editMessage: null,
init: false,
+ delayed: false,
error: false,
keyboard: false,
locked: false,
sealKey: null,
+ delayed: false,
});
+ const init = useRef(true);
const delay = useRef(null);
const conversation = useContext(ConversationContext);
const account = useContext(AccountContext);
@@ -33,15 +36,6 @@ export function useConversation() {
setState((s) => ({ ...s, ...value }));
}
-const converPem = (str) => {
- var result = '';
- while (str.length > 0) {
- result += str.substring(0, 64) + '\n';
- str = str.substring(64);
- }
- return result;
-}
-
useEffect(() => {
let sealKey;
const { locked, seals } = conversation.state;
@@ -59,6 +53,7 @@ const converPem = (str) => {
useEffect(() => {
const { error, subject, logo, topics, host, init } = conversation.state;
+
const items = Array.from(topics.values());
const sorted = items.sort((a, b) => {
const aTimestamp = a?.detail?.created;
@@ -72,18 +67,17 @@ const converPem = (str) => {
return -1;
});
const filtered = sorted.filter(item => !(item.blocked === 1));
- updateState({ subject, logo, host, error, topics: filtered });
- if (init) {
- clearTimeout(delay.current);
- updateState({ init: true });
+
+ if (!init) {
+ setTimeout(() => {
+ updateState({ delayed: true });
+ }, 500);
}
else {
- if (!delay.current) {
- delay.current = setTimeout(() => {
- updateState({ init: false });
- }, 500);
- }
+ updateState({ delayed: false });
}
+
+ updateState({ init, subject, logo, host, error, topics: filtered });
}, [conversation]);
const actions = {
diff --git a/app/mobile/src/session/profile/profileBody/ProfileBody.jsx b/app/mobile/src/session/profile/profileBody/ProfileBody.jsx
index 1415a02e..6272841e 100644
--- a/app/mobile/src/session/profile/profileBody/ProfileBody.jsx
+++ b/app/mobile/src/session/profile/profileBody/ProfileBody.jsx
@@ -157,10 +157,12 @@ export function ProfileBody({ navigation }) {
-
-
- Sealed Topics
-
+ { state.sealable && (
+
+
+ Sealed Topics
+
+ )}
Change Login
diff --git a/app/mobile/src/session/profile/profileBody/useProfileBody.hook.js b/app/mobile/src/session/profile/profileBody/useProfileBody.hook.js
index 8a37aa73..e7ed5e10 100644
--- a/app/mobile/src/session/profile/profileBody/useProfileBody.hook.js
+++ b/app/mobile/src/session/profile/profileBody/useProfileBody.hook.js
@@ -17,6 +17,7 @@ export function useProfileBody() {
description: null,
node: null,
imageSource: null,
+ sealable: false,
searchable: null,
notifications: null,
showDetailEdit: false,
@@ -83,11 +84,11 @@ export function useProfileBody() {
}, [profile]);
useEffect(() => {
- const { searchable, pushEnabled, seal } = account.state.status;
+ const { searchable, pushEnabled, seal, sealable } = account.state.status;
const sealKey = account.state.sealKey;
const sealEnabled = seal?.publicKey != null;
const sealUnlocked = seal?.publicKey === sealKey?.public && sealKey?.private && sealKey?.public;
- updateState({ searchable, pushEnabled, seal, sealKey, sealEnabled, sealUnlocked });
+ updateState({ searchable, sealable, pushEnabled, seal, sealKey, sealEnabled, sealUnlocked });
}, [account]);
useEffect(() => {