Skip to content

Commit

Permalink
removes save dialog (again) and fixes minor compilation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
dxenes1 committed Feb 6, 2025
1 parent 14e89ff commit 640391d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 27 deletions.
15 changes: 5 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions src/neuroglancer/save_state/save_state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {StatusMessage} from 'neuroglancer/status';
import {RefCounted} from 'neuroglancer/util/disposable';
import {getRandomHexString} from 'neuroglancer/util/random';
import {Trackable} from 'neuroglancer/util/trackable';
import {UrlType, Viewer} from 'neuroglancer/viewer';
import {Viewer} from 'neuroglancer/viewer';


const deprecatedKey = 'neuroglancerSaveState';
Expand Down Expand Up @@ -181,9 +181,7 @@ export class SaveState extends RefCounted {
private overwriteHistory(newHistory: SaveHistory[] = []) {
this.robustSet(historyKey, JSON.stringify(newHistory));
}
public showSaveDialog(viewer: Viewer, jsonString?: string, get?: UrlType, hidden = true) {
return false;
}

public showHistory(viewer: Viewer) {
new SaveHistoryDialog(viewer, this);
}
Expand Down
2 changes: 1 addition & 1 deletion src/neuroglancer/segmentation_user_layer_with_graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ function helper<TBase extends BaseConstructor>(Base: TBase) {
if (this.chunkedGraphLayer) {
const cgl = this.chunkedGraphLayer;
this.safeToSubmit('Merge', () => {
cgl.mergeSegments(lastSegmentSelection, currentSegmentSelection).then((mergeResponse) => {
cgl.mergeSegments(lastSegmentSelection, currentSegmentSelection).then((mergeResponse: any) => {
const mergedRoot = Uint64.parseString(mergeResponse['new_root_ids'][0]);
const mergeOperationId = cgl.getOperationIdFromOperationResponse(mergeResponse);
rootSegmentsAfterEdit!.clear();
Expand Down
13 changes: 1 addition & 12 deletions src/neuroglancer/viewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -896,10 +896,6 @@ export class Viewer extends RefCounted implements ViewerState {
new UserReportDialog(this, image);
}

showSaveDialog(getUrlType?: UrlType, jsonString?: string) {
this.saver!.showSaveDialog(this, jsonString, getUrlType, true);
}

showHistory() {
this.saver!.showHistory(this);
}
Expand Down Expand Up @@ -954,7 +950,6 @@ export class Viewer extends RefCounted implements ViewerState {
const entry = this.saver.pull();
if (savedUrl && !entry.dirty) {
callback();
this.showSaveDialog(getUrlType, this.saver.savedUrl);
return;
}
}
Expand All @@ -978,7 +973,6 @@ export class Viewer extends RefCounted implements ViewerState {
}
if (savestate) {
callback();
this.showSaveDialog(getUrlType, response);
}
StatusMessage.showTemporaryMessage(`Successfully shared state.`, 4000);
postSuccess = true;
Expand All @@ -1004,7 +998,6 @@ export class Viewer extends RefCounted implements ViewerState {
saverToggle(true);
if (!postSuccess && savestate) {
callback();
this.showSaveDialog(getUrlType);
}
}),
{
Expand All @@ -1015,15 +1008,11 @@ export class Viewer extends RefCounted implements ViewerState {
} else {
if (getUrlType === UrlType.json) {
StatusMessage.showTemporaryMessage(`No state server found.`, 4000, {color: 'yellow'});
this.showSaveDialog();
} else {
this.showSaveDialog(getUrlType);
}
}
}
} else {
if (savestate) {
callback();
this.showSaveDialog(getUrlType);
}
}
}
Expand Down

0 comments on commit 640391d

Please sign in to comment.