js: Simplify indexing arrays from the end with Array#at.

https://github.com/tc39/proposal-relative-indexing-method

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2022-01-24 00:05:06 -08:00
committed by Tim Abbott
parent 0b03628324
commit c6b372b471
13 changed files with 26 additions and 33 deletions

View File

@@ -242,7 +242,7 @@ export function setup_upload(config) {
return;
}
const split_uri = uri.split("/");
const filename = split_uri[split_uri.length - 1];
const filename = split_uri.at(-1);
if (config.mode === "compose" && !compose_state.composing()) {
compose_actions.start("stream");
}