Skip to content

fix: Store dismissedBanner key in localStorage #5388

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Dec 12, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
cleanup
  • Loading branch information
Kira-Pilot committed Dec 12, 2022
commit fd7af7d2734f4915d76fe90a65da229e45c34e14
7 changes: 0 additions & 7 deletions site/src/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -407,14 +407,7 @@ export const getBuildInfo = async (): Promise<TypesGen.BuildInfoResponse> => {
export const getUpdateCheck =
async (): Promise<TypesGen.UpdateCheckResponse> => {
const response = await axios.get("/api/v2/updatecheck")
// return {
// current: true,
// url: "https://github.com/coder/coder/releases/tag/v0.13.1",
// version: "v0.13.1"
// }
console.log('response.data', response.data)
return response.data
return { current: false, version: 'v0.13.1', url: 'https://github.com/coder/coder/releases/tag/v0.13.1' }
}

export const putWorkspaceAutostart = async (
Expand Down
4 changes: 3 additions & 1 deletion site/src/xServices/updateCheck/updateCheckXService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ export const updateCheckMachine = createMachine(
permissions: (_, event) => event.data as Permissions,
}),
assignShow: assign((context) => ({
show: localStorage.getItem("dismissedVersion") !== context.updateCheck?.version,
show:
localStorage.getItem("dismissedVersion") !==
context.updateCheck?.version,
})),
assignHide: assign({
show: false,
Expand Down