Skip to content

Commit

Permalink
[temp] remove some things
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaellehmkuhl committed Dec 10, 2024
1 parent aa17daa commit c22259b
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/libs/utils.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
/* eslint-disable @typescript-eslint/no-explicit-any */

import { useInteractionDialog } from '@/composables/interactionDialog'

const { showDialog } = useInteractionDialog()

export const constrain = (value: number, min: number, max: number): number => {
return Math.max(Math.min(value, max), min)
}
Expand Down Expand Up @@ -135,7 +131,7 @@ export const tryOrAlert = async (tryFunction: () => Promise<void>): Promise<void
try {
await tryFunction()
} catch (error) {
showDialog({ message: error as string, variant: 'error' })
console.error(error as string)
}
}

Expand All @@ -145,8 +141,7 @@ export const tryOrAlert = async (tryFunction: () => Promise<void>): Promise<void
*/
export const reloadCockpit = (timeout = 500): void => {
const restartMessage = `Restarting Cockpit in ${timeout / 1000} seconds...`
console.log(restartMessage)
showDialog({ message: restartMessage, variant: 'info', timer: timeout })
console.info(restartMessage)
setTimeout(() => location.reload(), timeout)
}

Expand Down

0 comments on commit c22259b

Please sign in to comment.