Skip to content

Commit

Permalink
Replaced GWT Storage API with Elemental2 WebStorage API
Browse files Browse the repository at this point in the history
  • Loading branch information
salmonb committed Feb 20, 2024
1 parent 1cbae18 commit f9c2630
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions webfx-kit/webfx-kit-javafxgraphics-peers-gwt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
</dependency>

<dependency>
<groupId>org.gwtproject</groupId>
<artifactId>gwt-user</artifactId>
<groupId>com.google.elemental2</groupId>
<artifactId>elemental2-webstorage</artifactId>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package dev.webfx.kit.mapper.peers.javafxgraphics.gwt.html;

import com.google.gwt.storage.client.Storage;
import dev.webfx.kit.mapper.peers.javafxgraphics.HasNoChildrenPeers;
import dev.webfx.kit.mapper.peers.javafxgraphics.NodePeer;
import dev.webfx.kit.mapper.peers.javafxgraphics.emul_coupling.base.ScenePeerBase;
Expand All @@ -15,6 +14,7 @@
import dev.webfx.platform.util.Strings;
import dev.webfx.platform.util.collection.Collections;
import elemental2.dom.*;
import elemental2.webstorage.WebStorageWindow;
import javafx.collections.ListChangeListener;
import javafx.collections.ObservableList;
import javafx.event.EventType;
Expand Down Expand Up @@ -180,7 +180,7 @@ private void installFontsListener() {
UiScheduler.scheduleInAnimationFrame(this::onCssOrFontLoaded, 5); // 5 animation frames seem enough on localhost or when fonts were cached
UiScheduler.scheduleInAnimationFrame(this::onCssOrFontLoaded, 30); // 30 animation frames seem enough on internet on first page load
// Temporary code to test other frameCount values if the previous ones were not enough:
String fontsReadySubsequentFrameCount = Storage.getLocalStorageIfSupported().getItem("fontsReadySubsequentFrameCount");
String fontsReadySubsequentFrameCount = WebStorageWindow.of(DomGlobal.window).localStorage.getItem("fontsReadySubsequentFrameCount");
if (fontsReadySubsequentFrameCount != null) {
int frameCount = Numbers.parseInteger(fontsReadySubsequentFrameCount);
Console.log("fontsReadySubsequentFrameCount = " + frameCount);
Expand Down

0 comments on commit f9c2630

Please sign in to comment.