diff --git a/api/src/main/java/telegram/files/Transfer.java b/api/src/main/java/telegram/files/Transfer.java index 95c35d0..3102d4d 100644 --- a/api/src/main/java/telegram/files/Transfer.java +++ b/api/src/main/java/telegram/files/Transfer.java @@ -68,6 +68,7 @@ public abstract class Transfer { } FileUtil.move(Path.of(fileRecord.localPath()), Path.of(transferPath), isOverwrite); + log.info("Transfer file {} to {}, duplication policy: {} overwrite: {}", fileRecord.id(), transferPath, duplicationPolicy, isOverwrite); transferStatusUpdated.accept(new TransferStatusUpdated(fileRecord, FileRecord.TransferStatus.completed, transferPath)); } catch (Exception e) { diff --git a/request.http b/request.http index b8d71b1..99d1044 100644 --- a/request.http +++ b/request.http @@ -172,3 +172,12 @@ Cookie: {{tf}} "@type": 1352130963 } } + +### Telegram RequestQrCodeAuthentication +POST http://{{server}}/telegram/api/RequestQrCodeAuthentication +Content-Type: application/json +Cookie: {{tf}} + +{ + "otherUserIds": null +} diff --git a/web/package-lock.json b/web/package-lock.json index e833bad..aba855c 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -43,6 +43,7 @@ "next": "^15.0.1", "next-themes": "^0.4.4", "pretty-bytes": "^6.1.1", + "qr-code-styling": "^1.9.1", "react": "^18.3.1", "react-dom": "^18.3.1", "react-hook-form": "^7.53.2", @@ -6923,6 +6924,24 @@ "node": ">=6" } }, + "node_modules/qr-code-styling": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/qr-code-styling/-/qr-code-styling-1.9.1.tgz", + "integrity": "sha512-T/VxQchuZkQwYhIcyyMUmtXHPeDT6lJBYHfqGD5CBDyIjswxS7JZKf443q+SXO1K/9SUswi6JpXEUQ5AoMCpyg==", + "license": "MIT", + "dependencies": { + "qrcode-generator": "^1.4.4" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/qrcode-generator": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/qrcode-generator/-/qrcode-generator-1.4.4.tgz", + "integrity": "sha512-HM7yY8O2ilqhmULxGMpcHSF1EhJJ9yBj8gvDEuZ6M+KGJ0YY2hKpnXvRD+hZPLrDVck3ExIGhmPtSdcjC+guuw==", + "license": "MIT" + }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -12608,6 +12627,19 @@ "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "dev": true }, + "qr-code-styling": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/qr-code-styling/-/qr-code-styling-1.9.1.tgz", + "integrity": "sha512-T/VxQchuZkQwYhIcyyMUmtXHPeDT6lJBYHfqGD5CBDyIjswxS7JZKf443q+SXO1K/9SUswi6JpXEUQ5AoMCpyg==", + "requires": { + "qrcode-generator": "^1.4.4" + } + }, + "qrcode-generator": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/qrcode-generator/-/qrcode-generator-1.4.4.tgz", + "integrity": "sha512-HM7yY8O2ilqhmULxGMpcHSF1EhJJ9yBj8gvDEuZ6M+KGJ0YY2hKpnXvRD+hZPLrDVck3ExIGhmPtSdcjC+guuw==" + }, "queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", diff --git a/web/package.json b/web/package.json index e3c6fbe..564b1bb 100644 --- a/web/package.json +++ b/web/package.json @@ -51,6 +51,7 @@ "next": "^15.0.1", "next-themes": "^0.4.4", "pretty-bytes": "^6.1.1", + "qr-code-styling": "^1.9.1", "react": "^18.3.1", "react-dom": "^18.3.1", "react-hook-form": "^7.53.2", diff --git a/web/public/blank.png b/web/public/blank.png new file mode 100644 index 0000000..909c66d Binary files /dev/null and b/web/public/blank.png differ diff --git a/web/src/components/account-creator.tsx b/web/src/components/account-creator.tsx index f670ac2..0e657de 100644 --- a/web/src/components/account-creator.tsx +++ b/web/src/components/account-creator.tsx @@ -3,7 +3,13 @@ import useSWRMutation from "swr/mutation"; import { request } from "@/lib/api"; import { useToast } from "@/hooks/use-toast"; import { useSWRConfig } from "swr"; -import React, { type FormEvent, useCallback, useEffect, useState } from "react"; +import React, { + type FormEvent, + useCallback, + useEffect, + useRef, + useState, +} from "react"; import { useDebounce } from "use-debounce"; import { Ellipsis, LoaderCircle } from "lucide-react"; import { Button } from "@/components/ui/button"; @@ -23,7 +29,9 @@ import { import { useWebsocket } from "@/hooks/use-websocket"; import { useTelegramAccount } from "@/hooks/use-telegram-account"; import TGDuck16Plane from "@/components/animations/tg-duck16_plane.json"; +import TGQRPlane from "@/components/animations/tg-qr-plane.json"; import dynamic from "next/dynamic"; +import QRCodeStyling, { Options } from "qr-code-styling"; interface AccountCreatorProps { isAdd?: boolean; @@ -47,6 +55,7 @@ export default function AccountCreator({ const { account, resetAccount } = useTelegramAccount(); const [initSuccessfully, setInitSuccessfully] = useState(false); const [authState, setAuthState] = useState(undefined); + const [qrCodeLink, setQrCodeLink] = useState(undefined); const [phoneNumber, setPhoneNumber] = useState(""); const [code, setCode] = useState(""); const [password, setPassword] = useState(""); @@ -84,6 +93,10 @@ export default function AccountCreator({ case TelegramConstructor.WAIT_PASSWORD: setAuthState(state.constructor); break; + case TelegramConstructor.WAIT_OTHER_DEVICE_CONFIRMATION: + setAuthState(state.constructor); + setQrCodeLink(state.link as string); + break; case TelegramConstructor.STATE_READY: toast({ title: "Success", @@ -204,6 +217,9 @@ export default function AccountCreator({ /> ), + [TelegramConstructor.WAIT_OTHER_DEVICE_CONFIRMATION]: ( + + ), [TelegramConstructor.WAIT_CODE]: (
@@ -273,24 +289,123 @@ export default function AccountCreator({ } }; + const handleRequestQrCodeAuthentication = async () => { + await triggerMethod({ + data: { + otherUserIds: null, + }, + method: "RequestQrCodeAuthentication", + }); + }; + return (
{authState && ( <> {authStateFormFields[authState]} - + {authState !== TelegramConstructor.WAIT_OTHER_DEVICE_CONFIRMATION && ( + + )} + {authState === TelegramConstructor.WAIT_PHONE_NUMBER && ( + + )} )}
); } + +const options: Options = { + width: 280, + height: 280, + type: "svg", + image: "blank.png", + margin: 10, + qrOptions: { + errorCorrectionLevel: "M", + }, + cornersSquareOptions: { + type: "extra-rounded", + }, + imageOptions: { + imageSize: 0.4, + margin: 8, + }, + dotsOptions: { + type: "rounded", + }, +}; + +function QRCode({ link }: { link?: string }) { + const [qrCode, setQrCode] = useState(); + const ref = useRef(null); + + useEffect(() => { + if (ref.current) { + qrCode?.append(ref.current); + } + }, [qrCode, ref]); + + useEffect(() => { + if (link) { + if (!qrCode) { + const qrCode = new QRCodeStyling({ + ...options, + data: link, + }); + setQrCode(qrCode); + } else { + qrCode.update({ + data: link, + }); + } + } + }, [link, qrCode]); + + if (!link) { + return ( +
+ +
+ ); + } + + return ( +
+
+
+ +
+
+

+ Scan the QR code with your telegram app to log in. +

+
+
+ ); +} diff --git a/web/src/components/animations/tg-qr-plane.json b/web/src/components/animations/tg-qr-plane.json new file mode 100644 index 0000000..eace788 --- /dev/null +++ b/web/src/components/animations/tg-qr-plane.json @@ -0,0 +1 @@ +{"tgs":1,"v":"5.5.2","fr":60,"ip":20,"op":74,"w":512,"h":512,"nm":"4","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":3,"nm":"Null 2","sr":1,"ks":{"o":{"a":0,"k":0},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":20,"s":[253.375,252.125,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":24,"s":[260.5,258.625,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":28,"s":[253.375,252.125,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":33,"s":[260.5,258.625,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":38,"s":[253.375,252.125,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":42,"s":[260.5,258.625,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":47,"s":[253.375,252.125,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":51,"s":[260.5,258.625,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":55,"s":[253.375,252.125,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":60,"s":[260.5,258.625,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":64,"s":[253.375,252.125,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":69,"s":[260.5,258.625,0],"to":[0,0,0],"ti":[0,0,0]},{"t":73,"s":[253.375,252.125,0]}]}},"ao":0,"ip":0,"op":180,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":3,"nm":"Null 1","parent":1,"sr":1,"ks":{"o":{"a":0,"k":0},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":20,"s":[-1,-22.5,0],"to":[11,-5.75,0],"ti":[8.25,-6.75,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":42.084,"s":[19,1.25,0],"to":[-8.25,6.75,0],"ti":[5,7,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":52.684,"s":[0,0,0],"to":[-5,-7,0],"ti":[-11,5.75,0]},{"t":73,"s":[-1,-22.5,0]}]}},"ao":0,"ip":0,"op":180,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"Plane","parent":2,"sr":1,"ks":{"r":{"a":1,"k":[{"i":{"x":[0.69],"y":[1]},"o":{"x":[0.31],"y":[0]},"t":22,"s":[-52]},{"i":{"x":[0.69],"y":[1]},"o":{"x":[0.31],"y":[0]},"t":47,"s":[-46]},{"t":73,"s":[-52]}]},"p":{"a":1,"k":[{"i":{"x":0.69,"y":0.452},"o":{"x":0.31,"y":0},"t":20,"s":[13.035,0.078,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.69,"y":1},"o":{"x":0.31,"y":0.253},"t":42,"s":[15.045,-3.387,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.69,"y":1},"o":{"x":0.31,"y":0},"t":68,"s":[10.025,5.541,0],"to":[0,0,0],"ti":[0,0,0]},{"t":73,"s":[13.035,0.078,0]}]},"a":{"a":0,"k":[12.637,41.19,0]}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ks":{"a":1,"k":[{"i":{"x":0.5,"y":1},"o":{"x":0.5,"y":0},"t":20,"s":[{"i":[[-9.785,-2.748],[0,0],[10.073,-3.525],[0,0],[2.014,8.701],[0,0],[-10.841,-0.565],[0,0],[4.226,0.677],[0,0],[4.908,4.225],[5.646,8.06]],"o":[[0,0],[10.58,2.999],[0,0],[-12.974,4.687],[0,0],[-0.722,-6.213],[0,0],[4.378,0.17],[0,0],[-8.58,-1.284],[-8.728,-7.514],[-4.055,-5.788]],"v":[[-86.852,-21.107],[121.04,37.828],[121.043,49.217],[-1.939,95.039],[-35.635,89.169],[-66.913,39.948],[-49.277,27.303],[43.295,34.291],[44.526,30.201],[-61.21,11.74],[-83.062,5.284],[-99.928,-14.021]],"c":true}]},{"i":{"x":0.5,"y":1},"o":{"x":0.5,"y":0},"t":44.732,"s":[{"i":[[-9.785,-5.623],[0,0],[10.073,-7.212],[0,0],[2.014,17.803],[0,0],[-10.841,-1.157],[0,0],[4.225,1.386],[0,0],[4.908,8.645],[4.363,17.802]],"o":[[0,0],[10.58,6.137],[0,0],[-12.974,9.59],[0,0],[1.88,-12.095],[0,0],[4.378,0.348],[0,0],[-8.58,-2.628],[-8.728,-15.375],[-2.98,-12.157]],"v":[[-80.291,-79.452],[116.546,26.896],[117.812,56.207],[-25.252,167.906],[-57.833,157.377],[-63.507,81.884],[-38.439,58.15],[33.696,48.095],[32.959,37.461],[-54.013,17.63],[-75.012,0.191],[-96.665,-61.799]],"c":true}]},{"t":73,"s":[{"i":[[-9.785,-2.748],[0,0],[10.073,-3.525],[0,0],[2.014,8.701],[0,0],[-10.841,-0.565],[0,0],[4.226,0.677],[0,0],[4.908,4.225],[5.646,8.06]],"o":[[0,0],[10.58,2.999],[0,0],[-12.974,4.687],[0,0],[-0.722,-6.213],[0,0],[4.378,0.17],[0,0],[-8.58,-1.284],[-8.728,-7.514],[-4.055,-5.788]],"v":[[-86.852,-21.107],[121.04,37.828],[121.043,49.217],[-1.939,95.039],[-35.635,89.169],[-66.913,39.948],[-49.277,27.303],[43.295,34.291],[44.526,30.201],[-61.21,11.74],[-83.062,5.284],[-99.928,-14.021]],"c":true}]}]},"nm":"Path 1","hd":false},{"ty":"fl","c":{"a":0,"k":[0.996078431606,1,0.992156863213,1]},"o":{"a":0,"k":100},"r":1,"bm":0,"nm":"Fill 1","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0]},"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"r":{"a":0,"k":0},"o":{"a":0,"k":100},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"nm":"Transform"}],"nm":"Group 1","bm":0,"hd":false}],"ip":0,"op":180,"st":0,"bm":0},{"ddd":0,"ind":4,"ty":4,"nm":"Shape Layer 15","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":60,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":63,"s":[25]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":74,"s":[25]},{"t":76,"s":[0]}]},"r":{"a":0,"k":-26},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":60,"s":[306,219.75,0],"to":[0,0,0],"ti":[0,0,0]},{"t":78,"s":[156,433.75,0]}]},"a":{"a":0,"k":[-48,115.75,0]}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ks":{"a":0,"k":{"i":[[-48.764,37.839],[0,0]],"o":[[-52.592,18.536],[0,0]],"v":[[15.662,84.004],[-90.5,140.75]],"c":true}},"nm":"Path 1","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1]},"o":{"a":0,"k":100},"r":1,"bm":0,"nm":"Fill 1","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0]},"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"r":{"a":0,"k":0},"o":{"a":0,"k":100},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"nm":"Transform"}],"nm":"Shape 1","bm":0,"hd":false}],"ip":63,"op":79,"st":58,"bm":0},{"ddd":0,"ind":5,"ty":4,"nm":"Shape Layer 14","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":61,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":64,"s":[25]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":75,"s":[25]},{"t":77,"s":[0]}]},"r":{"a":0,"k":-2},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":61,"s":[295,115.75,0],"to":[0,0,0],"ti":[0,0,0]},{"t":78,"s":[61,251.75,0]}]},"a":{"a":0,"k":[-48,115.75,0]}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ks":{"a":0,"k":{"i":[[-48.764,37.839],[0,0]],"o":[[-52.592,18.536],[0,0]],"v":[[15.662,84.004],[-90.5,140.75]],"c":true}},"nm":"Path 1","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1]},"o":{"a":0,"k":100},"r":1,"bm":0,"nm":"Fill 1","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0]},"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"r":{"a":0,"k":0},"o":{"a":0,"k":100},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"nm":"Transform"}],"nm":"Shape 1","bm":0,"hd":false}],"ip":58,"op":79,"st":58,"bm":0},{"ddd":0,"ind":6,"ty":4,"nm":"Shape Layer 13","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":71,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":73,"s":[25]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":86,"s":[25]},{"t":88,"s":[0]}]},"r":{"a":0,"k":-30},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":70,"s":[425.5,256.75,0],"to":[0,0,0],"ti":[0,0,0]},{"t":88,"s":[330,420.75,0]}]},"a":{"a":0,"k":[-48,115.75,0]}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ks":{"a":0,"k":{"i":[[-48.764,37.839],[0,0]],"o":[[-52.592,18.536],[0,0]],"v":[[15.662,84.004],[-90.5,140.75]],"c":true}},"nm":"Path 1","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1]},"o":{"a":0,"k":100},"r":1,"bm":0,"nm":"Fill 1","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0]},"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"r":{"a":0,"k":0},"o":{"a":0,"k":100},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"nm":"Transform"}],"nm":"Shape 1","bm":0,"hd":false}],"ip":69,"op":89,"st":57,"bm":0},{"ddd":0,"ind":7,"ty":4,"nm":"Shape Layer 7","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":19,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":22,"s":[25]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":33,"s":[25]},{"t":35,"s":[0]}]},"r":{"a":0,"k":-10},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":19,"s":[342,179.75,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":24,"s":[198.222,265.139,0],"to":[0,0,0],"ti":[0,0,0]},{"t":37,"s":[91,347.75,0]}]},"a":{"a":0,"k":[-48,115.75,0]}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ks":{"a":0,"k":{"i":[[-37.553,32.937],[0,0]],"o":[[-49.159,17.891],[0,0]],"v":[[-19.012,99.623],[-91.313,140.068]],"c":true}},"nm":"Path 1","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1]},"o":{"a":0,"k":100},"r":1,"bm":0,"nm":"Fill 1","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0]},"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"r":{"a":0,"k":0},"o":{"a":0,"k":100},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"nm":"Transform"}],"nm":"Shape 1","bm":0,"hd":false}],"ip":24,"op":38,"st":10,"bm":0},{"ddd":0,"ind":8,"ty":4,"nm":"Shape Layer 6","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":34,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":37,"s":[25]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":46,"s":[25]},{"t":48,"s":[0]}]},"r":{"a":0,"k":8},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":34,"s":[307,75.75,0],"to":[0,0,0],"ti":[0,0,0]},{"t":52,"s":[80,166.75,0]}]},"a":{"a":0,"k":[-48,115.75,0]}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ks":{"a":0,"k":{"i":[[-37.553,32.937],[0,0]],"o":[[-49.159,17.891],[0,0]],"v":[[-19.012,99.623],[-91.313,140.068]],"c":true}},"nm":"Path 1","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1]},"o":{"a":0,"k":100},"r":1,"bm":0,"nm":"Fill 1","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0]},"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"r":{"a":0,"k":0},"o":{"a":0,"k":100},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"nm":"Transform"}],"nm":"Shape 1","bm":0,"hd":false}],"ip":33,"op":53,"st":4,"bm":0},{"ddd":0,"ind":9,"ty":4,"nm":"Shape Layer 5","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":6,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":9,"s":[25]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":20,"s":[25]},{"t":22,"s":[0]}]},"r":{"a":0,"k":-26},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":6,"s":[306,219.75,0],"to":[0,0,0],"ti":[0,0,0]},{"t":24,"s":[156,433.75,0]}]},"a":{"a":0,"k":[-48,115.75,0]}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ks":{"a":0,"k":{"i":[[-48.764,37.839],[0,0]],"o":[[-52.592,18.536],[0,0]],"v":[[15.662,84.004],[-90.5,140.75]],"c":true}},"nm":"Path 1","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1]},"o":{"a":0,"k":100},"r":1,"bm":0,"nm":"Fill 1","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0]},"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"r":{"a":0,"k":0},"o":{"a":0,"k":100},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"nm":"Transform"}],"nm":"Shape 1","bm":0,"hd":false}],"ip":9,"op":25,"st":4,"bm":0},{"ddd":0,"ind":10,"ty":4,"nm":"Shape Layer 4","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":7,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":10,"s":[25]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":21,"s":[25]},{"t":23,"s":[0]}]},"r":{"a":0,"k":-2},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":7,"s":[295,115.75,0],"to":[0,0,0],"ti":[0,0,0]},{"t":24,"s":[61,251.75,0]}]},"a":{"a":0,"k":[-48,115.75,0]}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ks":{"a":0,"k":{"i":[[-48.764,37.839],[0,0]],"o":[[-52.592,18.536],[0,0]],"v":[[15.662,84.004],[-90.5,140.75]],"c":true}},"nm":"Path 1","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1]},"o":{"a":0,"k":100},"r":1,"bm":0,"nm":"Fill 1","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0]},"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"r":{"a":0,"k":0},"o":{"a":0,"k":100},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"nm":"Transform"}],"nm":"Shape 1","bm":0,"hd":false}],"ip":4,"op":25,"st":4,"bm":0},{"ddd":0,"ind":11,"ty":4,"nm":"Shape Layer 3","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":28,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":31,"s":[25]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":42,"s":[25]},{"t":44,"s":[0]}]},"r":{"a":0,"k":-22},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":26,"s":[421,171.75,0],"to":[0,0,0],"ti":[0,0,0]},{"t":45,"s":[206,447.75,0]}]},"a":{"a":0,"k":[-48,115.75,0]}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ks":{"a":0,"k":{"i":[[-48.764,37.839],[0,0]],"o":[[-52.592,18.536],[0,0]],"v":[[15.662,84.004],[-90.5,140.75]],"c":true}},"nm":"Path 1","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1]},"o":{"a":0,"k":100},"r":1,"bm":0,"nm":"Fill 1","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0]},"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"r":{"a":0,"k":0},"o":{"a":0,"k":100},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"nm":"Transform"}],"nm":"Shape 1","bm":0,"hd":false}],"ip":25,"op":46,"st":4,"bm":0},{"ddd":0,"ind":12,"ty":4,"nm":"Shape Layer 2","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":20,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":23,"s":[25]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":35,"s":[25]},{"t":37,"s":[0]}]},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":20,"s":[274,94.75,0],"to":[0,0,0],"ti":[0,0,0]},{"t":37,"s":[98,197.75,0]}]},"a":{"a":0,"k":[-48,115.75,0]}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ks":{"a":0,"k":{"i":[[-48.764,37.839],[0,0]],"o":[[-52.592,18.536],[0,0]],"v":[[15.662,84.004],[-90.5,140.75]],"c":true}},"nm":"Path 1","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1]},"o":{"a":0,"k":100},"r":1,"bm":0,"nm":"Fill 1","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0]},"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"r":{"a":0,"k":0},"o":{"a":0,"k":100},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"nm":"Transform"}],"nm":"Shape 1","bm":0,"hd":false}],"ip":20,"op":38,"st":4,"bm":0},{"ddd":0,"ind":13,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":17,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":19,"s":[25]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":32,"s":[25]},{"t":34,"s":[0]}]},"r":{"a":0,"k":-30},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":16,"s":[425.5,256.75,0],"to":[0,0,0],"ti":[0,0,0]},{"t":34,"s":[330,420.75,0]}]},"a":{"a":0,"k":[-48,115.75,0]}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ks":{"a":0,"k":{"i":[[-48.764,37.839],[0,0]],"o":[[-52.592,18.536],[0,0]],"v":[[15.662,84.004],[-90.5,140.75]],"c":true}},"nm":"Path 1","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1]},"o":{"a":0,"k":100},"r":1,"bm":0,"nm":"Fill 1","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0]},"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"r":{"a":0,"k":0},"o":{"a":0,"k":100},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"nm":"Transform"}],"nm":"Shape 1","bm":0,"hd":false}],"ip":15,"op":35,"st":3,"bm":0},{"ddd":0,"ind":14,"ty":4,"nm":"Shape Layer 16","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":53,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":56,"s":[25]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":67,"s":[25]},{"t":69,"s":[0]}]},"r":{"a":0,"k":-27},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":53,"s":[419,205.75,0],"to":[0,0,0],"ti":[0,0,0]},{"t":70,"s":[231,452.75,0]}]},"a":{"a":0,"k":[-48,115.75,0]}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ks":{"a":0,"k":{"i":[[-48.764,37.839],[0,0]],"o":[[-52.592,18.536],[0,0]],"v":[[15.662,84.004],[-90.5,140.75]],"c":true}},"nm":"Path 1","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1]},"o":{"a":0,"k":100},"r":1,"bm":0,"nm":"Fill 1","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0]},"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"r":{"a":0,"k":0},"o":{"a":0,"k":100},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"nm":"Transform"}],"nm":"Shape 1","bm":0,"hd":false}],"ip":52,"op":71,"st":50,"bm":0},{"ddd":0,"ind":15,"ty":4,"nm":"Shape Layer 11","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":47,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":50,"s":[25]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":61,"s":[25]},{"t":63,"s":[0]}]},"r":{"a":0,"k":2},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":47,"s":[331,123.75,0],"to":[0,0,0],"ti":[0,0,0]},{"t":64,"s":[59,254.75,0]}]},"a":{"a":0,"k":[-48,115.75,0]}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ks":{"a":0,"k":{"i":[[-48.764,37.839],[0,0]],"o":[[-52.592,18.536],[0,0]],"v":[[15.662,84.004],[-90.5,140.75]],"c":true}},"nm":"Path 1","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1]},"o":{"a":0,"k":100},"r":1,"bm":0,"nm":"Fill 1","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0]},"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"r":{"a":0,"k":0},"o":{"a":0,"k":100},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"nm":"Transform"}],"nm":"Shape 1","bm":0,"hd":false}],"ip":46,"op":65,"st":44,"bm":0},{"ddd":0,"ind":16,"ty":4,"nm":"Shape Layer 8","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":40,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":42,"s":[25]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":55,"s":[25]},{"t":57,"s":[0]}]},"r":{"a":0,"k":-30},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":39,"s":[443,285.75,0],"to":[0,0,0],"ti":[0,0,0]},{"t":57,"s":[354,427.25,0]}]},"a":{"a":0,"k":[-48,115.75,0]}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ks":{"a":0,"k":{"i":[[-36.444,30.329],[0,0]],"o":[[-39.336,11.339],[0,0]],"v":[[-1.115,91.061],[-77.087,130.019]],"c":true}},"nm":"Path 1","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1]},"o":{"a":0,"k":100},"r":1,"bm":0,"nm":"Fill 1","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0]},"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"r":{"a":0,"k":0},"o":{"a":0,"k":100},"sk":{"a":0,"k":0},"sa":{"a":0,"k":0},"nm":"Transform"}],"nm":"Shape 1","bm":0,"hd":false}],"ip":38,"op":58,"st":26,"bm":0}]} \ No newline at end of file diff --git a/web/src/components/auto-download-dialog.tsx b/web/src/components/auto-download-dialog.tsx index 59f26e0..5b5168c 100644 --- a/web/src/components/auto-download-dialog.tsx +++ b/web/src/components/auto-download-dialog.tsx @@ -546,11 +546,11 @@ const PolicyLegends: Record< }, OVERWRITE: { title: "Overwrite", - description: "This will overwrite the existing file if it already exists.", + description: "If destination exists same name file, move and overwrite the file.", }, SKIP: { title: "Skip", - description: "This will skip the file if it already exists.", + description: "If destination exists same name file, skip the file, nothing to do.", }, RENAME: { title: "Rename", diff --git a/web/src/lib/websocket-types.ts b/web/src/lib/websocket-types.ts index c916d06..687becf 100644 --- a/web/src/lib/websocket-types.ts +++ b/web/src/lib/websocket-types.ts @@ -28,4 +28,5 @@ export const TelegramConstructor = { WAIT_PHONE_NUMBER: 306402531, WAIT_CODE: 52643073, WAIT_PASSWORD: 112238030, + WAIT_OTHER_DEVICE_CONFIRMATION: 860166378, };