fileStorage: untangle file id/name

We were using file UUID and path interchangeable. This adds a new UUID
type for static checking and fixes a bunch of issues found.
This commit is contained in:
David Lechner
2022-04-01 17:24:00 -05:00
parent daa6c07910
commit 1709591afc
16 changed files with 420 additions and 278 deletions
+3 -2
View File
@@ -8,6 +8,7 @@ import React, { ReactElement } from 'react';
import { Provider } from 'react-redux';
import { AnyAction, DeepPartial, PreloadedState, createStore } from 'redux';
import { END, MulticastChannel, Saga, Task, runSaga, stdChannel } from 'redux-saga';
import { UUID } from '../src/fileStorage/actions';
import { RootState, rootReducer } from '../src/reducers';
import { RootSagaContext } from '../src/sagas';
@@ -159,6 +160,6 @@ export const testRender = (
*
* @param id A unique identifier.
*/
export function uuid(id: number): string {
return `${id.toString().padStart(8, '0')}-0000-0000-0000-000000000000`;
export function uuid(id: number): UUID {
return `${id.toString().padStart(8, '0')}-0000-0000-0000-000000000000` as UUID;
}