forked from cadence/out-of-your-element
seed initial setup
This commit is contained in:
parent
22dde9faf7
commit
38d7db5071
4 changed files with 57 additions and 2 deletions
|
@ -17,7 +17,14 @@ const inflight = new Map()
|
|||
* @param {string} path
|
||||
*/
|
||||
async function uploadDiscordFileToMxc(path) {
|
||||
const url = DISCORD_IMAGES_BASE + path
|
||||
let url
|
||||
if (path.startsWith("http")) {
|
||||
// TODO: this is cheating to make seed.js easier. due a refactor or a name change since it's not soley for discord?
|
||||
// possibly could be good to save non-discord external URLs under a user-specified key rather than simply using the url?
|
||||
url = path
|
||||
} else {
|
||||
url = DISCORD_IMAGES_BASE + path
|
||||
}
|
||||
|
||||
// Are we uploading this file RIGHT NOW? Return the same inflight promise with the same resolution
|
||||
let existing = inflight.get(url)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue