mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
fixed last seen message bug
This commit is contained in:
parent
b064c88943
commit
0eae79ec08
3 changed files with 9 additions and 9 deletions
|
@ -228,7 +228,7 @@ function* getUpdates() {
|
|||
const { error, data }: IResultWithStatus<{ notifications: INotification[] }> = yield call(
|
||||
reqWrapper,
|
||||
apiAuthGetUpdates,
|
||||
{ exclude_dialogs, last }
|
||||
{ exclude_dialogs, last: last || user.last_seen_messages }
|
||||
);
|
||||
|
||||
if (error || !data || !data.notifications || !data.notifications.length) return;
|
||||
|
@ -246,16 +246,14 @@ function* getUpdates() {
|
|||
function* startPollingSaga() {
|
||||
while (true) {
|
||||
yield call(getUpdates);
|
||||
yield delay(60000);
|
||||
yield delay(10000);
|
||||
}
|
||||
}
|
||||
|
||||
function* setLastSeenMessages({ last_seen_messages }: ReturnType<typeof authSetLastSeenMessages>) {
|
||||
if (!Date.parse(last_seen_messages)) return;
|
||||
|
||||
const { data, error } = yield call(reqWrapper, apiUpdateUser, { user: { last_seen_messages } });
|
||||
|
||||
console.log({ data, error });
|
||||
yield call(reqWrapper, apiUpdateUser, { user: { last_seen_messages } });
|
||||
}
|
||||
|
||||
function* authSaga() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue