diff --git a/resources/js/models/chat/create-announcement.ts b/resources/js/models/chat/create-announcement.ts index 51742489230..f2028d673fc 100644 --- a/resources/js/models/chat/create-announcement.ts +++ b/resources/js/models/chat/create-announcement.ts @@ -3,7 +3,6 @@ import UserJson from 'interfaces/user-json'; import { action, autorun, computed, makeObservable, observable } from 'mobx'; -import { uuid } from 'utils/seq'; import { present } from 'utils/string'; import { maxMessageLength } from './channel'; @@ -34,7 +33,7 @@ export default class CreateAnnouncement { @observable validUsers = new Map(); private initialized = false; - private readonly uuid = uuid(); + private readonly uuid = crypto.randomUUID(); @computed get errors() { diff --git a/resources/js/models/chat/message.ts b/resources/js/models/chat/message.ts index bedc568e47a..f266aabd43b 100644 --- a/resources/js/models/chat/message.ts +++ b/resources/js/models/chat/message.ts @@ -6,14 +6,13 @@ import { action, computed, makeObservable, observable } from 'mobx'; import User from 'models/user'; import * as moment from 'moment'; import core from 'osu-core-singleton'; -import { uuid } from 'utils/seq'; export default class Message { @observable channelId = -1; @observable content = ''; @observable errored = false; @observable isAction = false; - @observable messageId: number | string = uuid(); + @observable messageId: number | string = crypto.randomUUID(); @observable persisted = false; @observable senderId = -1; @observable timestamp: string = moment().toISOString(); diff --git a/resources/js/turbolinks-overrides.coffee b/resources/js/turbolinks-overrides.coffee index 929fd314b3d..258e0cc7e08 100644 --- a/resources/js/turbolinks-overrides.coffee +++ b/resources/js/turbolinks-overrides.coffee @@ -45,7 +45,7 @@ Turbolinks.Controller::advanceHistory = (url) -> location = @lastRenderedLocation @cache.put location, snapshot.clone() @lastRenderedLocation = Turbolinks.Location.wrap(url) - @pushHistoryWithLocationAndRestorationIdentifier url, Turbolinks.uuid() + @pushHistoryWithLocationAndRestorationIdentifier url, crypto.randomUUID() # @lastRenderedLocation must be updated so the most recent url will be used for @cache diff --git a/resources/js/turbolinks.d.ts b/resources/js/turbolinks.d.ts index 0b754d0d2dd..5dbc1b86052 100644 --- a/resources/js/turbolinks.d.ts +++ b/resources/js/turbolinks.d.ts @@ -31,7 +31,6 @@ declare module 'turbolinks' { controller: Controller; setProgressBarDelay(delayInMilliseconds: number): void; supported: boolean; - uuid(): string; visit(location: string, options?: TurbolinksAction): void; } } diff --git a/resources/js/utils/seq.ts b/resources/js/utils/seq.ts index 53ee52b5f00..62c32c1448a 100644 --- a/resources/js/utils/seq.ts +++ b/resources/js/utils/seq.ts @@ -6,7 +6,3 @@ let currVal = 0; export function nextVal() { return ++currVal; } - -export function uuid() { - return Turbolinks.uuid(); // no point rolling our own -}