Merge pull request #1059 from esteemapp/bugfix/logout

Fixed logout issue
This commit is contained in:
Mustafa Buyukcelebi 2019-08-23 11:52:17 +03:00 committed by GitHub
commit fd4b8ca3f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -187,7 +187,10 @@ export const updateUserData = userData =>
export const removeUserData = username => export const removeUserData = username =>
new Promise((resolve, reject) => { new Promise((resolve, reject) => {
try { try {
const account = realm.objects(USER_SCHEMA).filtered('username = $0', username); const account = Object.assign(
[],
realm.objects(USER_SCHEMA).filtered('username = $0', username),
);
if (Array.from(account).length > 0) { if (Array.from(account).length > 0) {
realm.write(() => { realm.write(() => {
realm.delete(account); realm.delete(account);