Clean up editor drafts for unknown rooms (#12850)
* Clean up editor drafts for unknown rooms and add tests. * lint * Call cleanUpDraftsIfRequired when we know a live update has completed. * Fix test for new call site of draft cleaning * fix test
This commit is contained in:
parent
6e7ddbbae9
commit
e6835fe9d2
4 changed files with 122 additions and 1 deletions
|
@ -143,6 +143,7 @@ import { checkSessionLockFree, getSessionLock } from "../../utils/SessionLock";
|
|||
import { SessionLockStolenView } from "./auth/SessionLockStolenView";
|
||||
import { ConfirmSessionLockTheftView } from "./auth/ConfirmSessionLockTheftView";
|
||||
import { LoginSplashView } from "./auth/LoginSplashView";
|
||||
import { cleanUpDraftsIfRequired } from "../../DraftCleaner";
|
||||
|
||||
// legacy export
|
||||
export { default as Views } from "../../Views";
|
||||
|
@ -1528,6 +1529,9 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
|||
}
|
||||
|
||||
if (state === SyncState.Syncing && prevState === SyncState.Syncing) {
|
||||
// We know we have performabed a live update and known rooms should be in a good state.
|
||||
// Now is a good time to clean up drafts.
|
||||
cleanUpDraftsIfRequired();
|
||||
return;
|
||||
}
|
||||
logger.debug(`MatrixClient sync state => ${state}`);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue