about summary refs log tree commit diff
path: root/src/state/queries/preferences/util.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/state/queries/preferences/util.ts')
-rw-r--r--src/state/queries/preferences/util.ts16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/state/queries/preferences/util.ts b/src/state/queries/preferences/util.ts
new file mode 100644
index 000000000..7b8160c28
--- /dev/null
+++ b/src/state/queries/preferences/util.ts
@@ -0,0 +1,16 @@
+import {LabelPreference} from '@atproto/api'
+
+/**
+ * Content labels previously included 'show', which has been deprecated in
+ * favor of 'ignore'. The API can return legacy data from the database, and
+ * we clean up the data in `usePreferencesQuery`.
+ *
+ * @deprecated
+ */
+export function temp__migrateLabelPref(
+  pref: LabelPreference | 'show',
+): LabelPreference {
+  // @ts-ignore
+  if (pref === 'show') return 'ignore'
+  return pref
+}