@equinor/fusion
Advanced tools
Comparing version 0.1.19 to 0.1.20
@@ -15,8 +15,15 @@ import { useState, useCallback, useEffect } from "react"; | ||
await this.setAsync("current", context); | ||
if (!history) { | ||
await this.setAsync("history", [currentContext]); | ||
if (!currentContext) { | ||
return; | ||
} | ||
else { | ||
await this.setAsync("history", [currentContext, ...history]); | ||
const newHistory = [currentContext]; | ||
if (history) { | ||
history | ||
// Remove the current context from the previous history (it's added to the start of the history) | ||
.filter(c => c.id !== currentContext.id) | ||
// Remove historical contexts after the last 10 (currentContext + 9) | ||
.slice(0, 9) | ||
.forEach(c => newHistory.push(c)); | ||
} | ||
await this.setAsync("history", newHistory); | ||
} | ||
@@ -23,0 +30,0 @@ getCurrentContext() { |
{ | ||
"name": "@equinor/fusion", | ||
"version": "0.1.19", | ||
"version": "0.1.20", | ||
"description": "Everything a Fusion app needs to communicate with the core", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
105028
2414