Remove nanoid dependency
Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
This commit is contained in:
parent
e083ef0d6d
commit
ce942ffe16
3 changed files with 20 additions and 30 deletions
|
@ -15,10 +15,20 @@ import subscriptionManager from "../app/SubscriptionManager";
|
|||
import poller from "../app/Poller";
|
||||
import DialogFooter from "./DialogFooter";
|
||||
import {useTranslation} from "react-i18next";
|
||||
import {customAlphabet} from 'nanoid/non-secure'
|
||||
|
||||
const publicBaseUrl = "https://ntfy.sh";
|
||||
const randomAlphanumericString = customAlphabet('abcdefghijklmnopqrstuvwxyz0123456789', 21);
|
||||
|
||||
const randomAlphanumericString = () => {
|
||||
const alphabet = 'abcdefghijklmnopqrstuvwxyz0123456789';
|
||||
const size = 16;
|
||||
|
||||
let id = '';
|
||||
let i = size;
|
||||
while (i--) {
|
||||
id += alphabet[(Math.random() * alphabet.length) | 0];
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
const SubscribeDialog = (props) => {
|
||||
const [baseUrl, setBaseUrl] = useState("");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue