about summary refs log tree commit diff
path: root/app/javascript/mastodon/actions/importer/normalizer.js
diff options
context:
space:
mode:
authorunarist <m.unarist@gmail.com>2018-03-26 19:48:01 +0900
committerEugen Rochko <eugen@zeonfederated.com>2018-03-26 12:48:01 +0200
commit605a92b4607589c64acf9c5cb58d2fcc68e2606a (patch)
tree88ab7dfadd9c8da517da52b32eb73a8ad1c7d4fb /app/javascript/mastodon/actions/importer/normalizer.js
parent3b2c7a33a9fe151b65724f9076a4ef93ad1d6948 (diff)
Fix moved account handling in IndexedDB feature (#6915)
* Fix stack overflow on importFetchedAccounts

  When the account has moved property, it should process destination
  account instead of source account itself.

* Set account id instead of account object for moved property

  This restores "foo has moved to" indication on account view, and
  fixes `reblog` index on `accounts` object store.
Diffstat (limited to 'app/javascript/mastodon/actions/importer/normalizer.js')
-rw-r--r--app/javascript/mastodon/actions/importer/normalizer.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/javascript/mastodon/actions/importer/normalizer.js b/app/javascript/mastodon/actions/importer/normalizer.js
index c88f6946f..1b09f319f 100644
--- a/app/javascript/mastodon/actions/importer/normalizer.js
+++ b/app/javascript/mastodon/actions/importer/normalizer.js
@@ -10,6 +10,10 @@ export function normalizeAccount(account) {
   account.display_name_html = emojify(escapeTextContentForBrowser(displayName));
   account.note_emojified = emojify(account.note);
 
+  if (account.moved) {
+    account.moved = account.moved.id;
+  }
+
   return account;
 }