Move
This commit is contained in:
@@ -22,7 +22,6 @@ import { updateMagicMetadata } from "@/new/photos/services/magic-metadata";
|
||||
import { safeDirectoryName } from "@/new/photos/utils/native-fs";
|
||||
import { LS_KEYS, getData } from "@ente/shared/storage/localStorage";
|
||||
import type { User } from "@ente/shared/user/types";
|
||||
import bs58 from "bs58";
|
||||
import { t } from "i18next";
|
||||
import {
|
||||
addToCollection,
|
||||
@@ -177,21 +176,6 @@ async function createCollectionDownloadFolder(
|
||||
return collectionDownloadPath;
|
||||
}
|
||||
|
||||
export function appendCollectionKeyToShareURL(
|
||||
url: string,
|
||||
collectionKey: string,
|
||||
) {
|
||||
if (!url) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const sharableURL = new URL(url);
|
||||
|
||||
const bytes = Buffer.from(collectionKey, "base64");
|
||||
sharableURL.hash = bs58.encode(bytes);
|
||||
return sharableURL.href;
|
||||
}
|
||||
|
||||
const _intSelectOption = (i: number) => {
|
||||
const label = i === 0 ? t("NO_DEVICE_LIMIT") : i.toString();
|
||||
return { label, value: i };
|
||||
|
||||
@@ -160,6 +160,9 @@ For more details, see [translations.md](translations.md).
|
||||
identifiers. For one particular use case, we also need
|
||||
[uuid](https://github.com/uuidjs/uuid) for UUID v4 generation.
|
||||
|
||||
- [bs58](https://github.com/cryptocoinjs/bs58) is used for base-58 conversion
|
||||
(used for encoding the collection key to use as the hash in the share URL).
|
||||
|
||||
- [debounce](https://github.com/sindresorhus/debounce) and its
|
||||
promise-supporting sibling
|
||||
[pDebounce](https://github.com/sindresorhus/p-debounce) are used for
|
||||
|
||||
Reference in New Issue
Block a user