Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Commit

Permalink
Change URL caching inside ThemeLoader. (#2318)
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Viranyi <matthias.viranyi@here.com>

Co-authored-by: Matthias Viranyi <matthias.viranyi@here.com>
  • Loading branch information
mviranyi and Matthias Viranyi committed Oct 14, 2021
1 parent 0bbc120 commit bd9d86e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
3 changes: 1 addition & 2 deletions @here/harp-mapview/lib/ThemeLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import {
IContextLogger,
ISimpleChannel,
RelativeUriResolver,
resolveReferenceUri,
UriResolver
} from "@here/harp-utils";

Expand Down Expand Up @@ -136,7 +135,7 @@ export class ThemeLoader {
throw new Error(`ThemeLoader#load: cannot load theme: ${response.statusText}`);
}
theme = (await response.json()) as Theme;
theme.url = resolveReferenceUri(getAppBaseUrl(), themeUrl);
theme.url = themeUrl;
theme = this.resolveUrls(theme, options);
} else if (theme.url === undefined) {
// assume that theme url is same as baseUrl
Expand Down
7 changes: 1 addition & 6 deletions @here/harp-mapview/test/ThemeLoaderTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,7 @@ describe("ThemeLoader", function () {

it("resolves absolute theme url of theme loaded from relative url", async function () {
const result = await ThemeLoader.load(sampleThemeUrl);
assert.equal(result.url, resolveReferenceUri(appBaseUrl, sampleThemeUrl));
});

it("resolves absolute url of theme loaded from relative url", async function () {
const result = await ThemeLoader.load(sampleThemeUrl);
assert.equal(result.url, resolveReferenceUri(appBaseUrl, sampleThemeUrl));
assert.equal(result.url, sampleThemeUrl);
});

it("resolves urls of resources embedded in theme", async function () {
Expand Down

0 comments on commit bd9d86e

Please sign in to comment.