mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-18 07:34:54 +00:00
extensions/shared: Don't cache detected URL
The translation functions we export from extension utils must work with all extensions, not only the first that calls one of the functions. That means that we are back to examining a backtrace for every function call unless an extension defined its own translation functions with `import.meta.url`. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2887>
This commit is contained in:
parent
4cb503d481
commit
af5dd7ddd1
1 changed files with 2 additions and 4 deletions
|
|
@ -218,10 +218,8 @@ export class GettextWrapper {
|
|||
}
|
||||
|
||||
#lookupExtension(funcName) {
|
||||
if (!this.#url)
|
||||
this.#url = this.#detectUrl();
|
||||
|
||||
const extension = this.#extensionClass.lookupByURL(this.#url);
|
||||
const url = this.#url ?? this.#detectUrl();
|
||||
const extension = this.#extensionClass.lookupByURL(url);
|
||||
if (!extension)
|
||||
throw new Error(`${funcName} can only be called from extensions`);
|
||||
return extension;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue