refactor: add typescript support to project
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
// import React from "react";
|
||||
import { KEY_PWA_INSTALLED } from "../../../app/config";
|
||||
|
||||
export default function usePrompt() {
|
||||
const resetPrompt = () => {
|
||||
localStorage.removeItem(KEY_PWA_INSTALLED);
|
||||
};
|
||||
const setPrompt = () => {
|
||||
localStorage.setItem(KEY_PWA_INSTALLED, true);
|
||||
};
|
||||
|
||||
return {
|
||||
setCanneled: setPrompt,
|
||||
prompted: !!localStorage.getItem(KEY_PWA_INSTALLED),
|
||||
resetPrompt
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user