diff --git a/.changeset/lucky-paws-sort.md b/.changeset/lucky-paws-sort.md new file mode 100644 index 000000000..4853a7d24 --- /dev/null +++ b/.changeset/lucky-paws-sort.md @@ -0,0 +1,5 @@ +--- +"@whereby.com/core": minor +--- + +Expose doSetRoomUrl diff --git a/packages/core/src/redux/slices/__tests__/organization.unit.ts b/packages/core/src/redux/slices/__tests__/organization.unit.ts index 691a596bc..158f65dc0 100644 --- a/packages/core/src/redux/slices/__tests__/organization.unit.ts +++ b/packages/core/src/redux/slices/__tests__/organization.unit.ts @@ -29,6 +29,7 @@ describe("deviceCredentialsSlice", () => { data: organizationData, isFetching: isFetchingOrganization, error: organizationError, + fetchedAt: 0, }; const deviceCredentialsRaw = { isFetching: isFetchingDeviceCredentials, diff --git a/packages/core/src/redux/slices/app.ts b/packages/core/src/redux/slices/app.ts index 6def69812..4c6e2eb63 100644 --- a/packages/core/src/redux/slices/app.ts +++ b/packages/core/src/redux/slices/app.ts @@ -59,6 +59,9 @@ export const appSlice = createSlice({ doAppStop: (state) => { return { ...state, isActive: false }; }, + doSetRoomUrl: (state, action: PayloadAction) => { + return { ...state, roomUrl: action.payload }; + }, }, }); @@ -66,7 +69,7 @@ export const appSlice = createSlice({ * Action creators */ -export const { doAppStop, doAppStart } = appSlice.actions; +export const { doAppStop, doAppStart, doSetRoomUrl } = appSlice.actions; /** * Selectors diff --git a/packages/core/src/redux/slices/organization.ts b/packages/core/src/redux/slices/organization.ts index 73c527fcb..2dd73e22f 100644 --- a/packages/core/src/redux/slices/organization.ts +++ b/packages/core/src/redux/slices/organization.ts @@ -14,12 +14,14 @@ export interface OrganizationState { data: Organization | null | undefined; isFetching: boolean; error: unknown; + fetchedAt: number | null; } const initialState: OrganizationState = { data: null, isFetching: false, error: null, + fetchedAt: null, }; export const organizationSlice = createSlice({ @@ -39,6 +41,7 @@ export const organizationSlice = createSlice({ ...state, isFetching: false, data: action.payload, + fetchedAt: Date.now(), }; }); builder.addCase(doOrganizationFetch.rejected, (state) => {