-
Notifications
You must be signed in to change notification settings - Fork 1
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
IS-1940: Add amplitude #393
Conversation
src/utils/miljoUtil.ts
Outdated
@@ -9,6 +9,10 @@ export const erLokal = (): boolean => { | |||
return window.location.host.indexOf('localhost') > -1; | |||
}; | |||
|
|||
export function isProd() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Husk å bytte til syfooversikt her ;)
5138e83
to
2fe530d
Compare
let temp: any = null; | ||
const localS = { | ||
getItem() { | ||
return temp; | ||
}, | ||
setItem(key: any, value: any) { | ||
temp = value; | ||
}, | ||
}; | ||
function localStorage() { | ||
let storage = {}; | ||
return { | ||
getItem: function (key: string) { | ||
return key in storage ? (storage as any)[key] : null; | ||
}, | ||
setItem: function (key: string, value: any) { | ||
(storage as any)[key] = value || ''; | ||
}, | ||
}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Den forrige funksjonen her hentet hva som helst som lå i temp
. Siden hverken set
eller get
funksjonen brukte key
så ville en verdi ble satt og den verdien returnert for alle som prøvde å bruke localstorage.
Hva har blitt lagt til✨🌈