Skip to content

Commit

Permalink
core: Expose doSetRoomUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
thyal committed Dec 9, 2024
1 parent 7abe6de commit b0cf867
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/lucky-paws-sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@whereby.com/core": minor
---

Expose doSetRoomUrl
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ describe("deviceCredentialsSlice", () => {
data: organizationData,
isFetching: isFetchingOrganization,
error: organizationError,
fetchedAt: 0,
};
const deviceCredentialsRaw = {
isFetching: isFetchingDeviceCredentials,
Expand Down
5 changes: 4 additions & 1 deletion packages/core/src/redux/slices/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,17 @@ export const appSlice = createSlice({
doAppStop: (state) => {
return { ...state, isActive: false };
},
doSetRoomUrl: (state, action: PayloadAction<string>) => {
return { ...state, roomUrl: action.payload };
},
},
});

/**
* Action creators
*/

export const { doAppStop, doAppStart } = appSlice.actions;
export const { doAppStop, doAppStart, doSetRoomUrl } = appSlice.actions;

/**
* Selectors
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/redux/slices/organization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -39,6 +41,7 @@ export const organizationSlice = createSlice({
...state,
isFetching: false,
data: action.payload,
fetchedAt: Date.now(),
};
});
builder.addCase(doOrganizationFetch.rejected, (state) => {
Expand Down

0 comments on commit b0cf867

Please sign in to comment.