@dra2020/baseclient 1.0.114 → 1.0.116
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/baseclient.js +15 -6
- package/dist/baseclient.js.map +1 -1
- package/lib/geo/geo.ts +7 -3
- package/lib/ot-js/otclientengine.ts +7 -3
- package/package.json +1 -1
package/dist/baseclient.js
CHANGED
|
@@ -2756,20 +2756,24 @@ class GeoMultiCollection {
|
|
|
2756
2756
|
if (!this.all.topo) {
|
|
2757
2757
|
// optimise case where one entry
|
|
2758
2758
|
let n = this.nEntries;
|
|
2759
|
+
let e = this.nthEntry(0);
|
|
2759
2760
|
if (n == 1) {
|
|
2760
|
-
let e = this.nthEntry(0);
|
|
2761
2761
|
this.all.topo = this._topo(e);
|
|
2762
2762
|
this.all.col = this.all.col || e.col;
|
|
2763
2763
|
this.all.map = this.all.map || e.map;
|
|
2764
2764
|
}
|
|
2765
|
-
else {
|
|
2765
|
+
else if (e.topo) {
|
|
2766
2766
|
// Old-style, goes through map (to filter hidden) and then collection
|
|
2767
2767
|
// this.all.topo = geoCollectionToTopoNonNull(this.allCol());
|
|
2768
2768
|
// New style, use splice on packed topologies
|
|
2769
|
+
let filterout = Util.isEmpty(this.hidden) ? null : this.hidden; // splice function requires NULL for empty
|
|
2769
2770
|
let topoarray = Object.values(this.entries).filter((e) => this._length(e) > 0)
|
|
2770
|
-
.map((e) => { return { topology: this._topo(e), filterout
|
|
2771
|
+
.map((e) => { return { topology: this._topo(e), filterout }; });
|
|
2771
2772
|
this.all.topo = topoarray.length == 0 ? null : topoarray.length == 1 ? topoarray[0].topology : Poly.topoSplice(topoarray);
|
|
2772
2773
|
}
|
|
2774
|
+
else
|
|
2775
|
+
// Old-style, goes through map (to filter hidden) and then collection
|
|
2776
|
+
this.all.topo = geoCollectionToTopoNonNull(this.allCol());
|
|
2773
2777
|
}
|
|
2774
2778
|
return this.all.topo;
|
|
2775
2779
|
}
|
|
@@ -4777,8 +4781,9 @@ class OTClientEngine extends OTE.OTEngine {
|
|
|
4777
4781
|
setReadOnly(b) {
|
|
4778
4782
|
if (b != this.bReadOnly) {
|
|
4779
4783
|
this.bReadOnly = b;
|
|
4780
|
-
|
|
4781
|
-
|
|
4784
|
+
//No longer necessary - especially since we want to allow local edits to be applied for temporary work.
|
|
4785
|
+
//if (this.bReadOnly)
|
|
4786
|
+
// this.failbackToServerState();
|
|
4782
4787
|
}
|
|
4783
4788
|
}
|
|
4784
4789
|
startLocalEdit() {
|
|
@@ -4946,7 +4951,11 @@ class OTClientEngine extends OTE.OTEngine {
|
|
|
4946
4951
|
// 4. An undo operation.
|
|
4947
4952
|
//
|
|
4948
4953
|
addLocalEdit(orig) {
|
|
4949
|
-
|
|
4954
|
+
//Comment out bReadOnly test to now allow changes to be locally applied for readonly sessions, for playing around.
|
|
4955
|
+
//Server still prevents any edits from actually being applied. And clientsession changes
|
|
4956
|
+
//Don't actually send edits as well.
|
|
4957
|
+
//if (! this.bReadOnly)
|
|
4958
|
+
{
|
|
4950
4959
|
try {
|
|
4951
4960
|
this.actionAllClient.compose(orig);
|
|
4952
4961
|
this.actionAllPendingClient.compose(orig);
|