From 2ebf4777c2b791357c352bfe1d21791e9a0a2502 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 15 Apr 2022 20:00:03 -0500 Subject: [PATCH] Nuke the local uuid implementation --- app/soapbox/actions/settings.js | 3 +-- app/soapbox/reducers/compose.js | 2 +- app/soapbox/uuid.js | 5 ----- 3 files changed, 2 insertions(+), 8 deletions(-) delete mode 100644 app/soapbox/uuid.js diff --git a/app/soapbox/actions/settings.js b/app/soapbox/actions/settings.js index 4c7768bd2..2338a4c4f 100644 --- a/app/soapbox/actions/settings.js +++ b/app/soapbox/actions/settings.js @@ -1,12 +1,11 @@ import { Map as ImmutableMap, List as ImmutableList, OrderedSet as ImmutableOrderedSet } from 'immutable'; import { defineMessages } from 'react-intl'; import { createSelector } from 'reselect'; +import { v4 as uuid } from 'uuid'; import { patchMe } from 'soapbox/actions/me'; import { isLoggedIn } from 'soapbox/utils/auth'; -import uuid from '../uuid'; - import { showAlertForError } from './alerts'; import snackbar from './snackbar'; diff --git a/app/soapbox/reducers/compose.js b/app/soapbox/reducers/compose.js index 010a59f08..5787e6ada 100644 --- a/app/soapbox/reducers/compose.js +++ b/app/soapbox/reducers/compose.js @@ -1,4 +1,5 @@ import { Map as ImmutableMap, List as ImmutableList, OrderedSet as ImmutableOrderedSet, fromJS } from 'immutable'; +import { v4 as uuid } from 'uuid'; import { tagHistory } from 'soapbox/settings'; import { PLEROMA } from 'soapbox/utils/features'; @@ -55,7 +56,6 @@ import { SETTING_CHANGE, FE_NAME } from '../actions/settings'; import { REDRAFT } from '../actions/statuses'; import { TIMELINE_DELETE } from '../actions/timelines'; import { unescapeHTML } from '../utils/html'; -import uuid from '../uuid'; const initialState = ImmutableMap({ id: null, diff --git a/app/soapbox/uuid.js b/app/soapbox/uuid.js deleted file mode 100644 index a10720cf8..000000000 --- a/app/soapbox/uuid.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -export default function uuid(a) { - return a ? (a^Math.random() * 16 >> a / 4).toString(16) : ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, uuid); -}