7
7
Typescript async/await rewrite of @cocalc/util/client.coffee...
8
8
*/
9
9
10
- import { Modal } from "antd" ;
11
10
import { Map } from "immutable" ;
12
-
13
11
import { redux } from "@cocalc/frontend/app-framework" ;
14
- import { excludeFromComputeServer } from "@cocalc/frontend/file-associations" ;
15
12
import { webapp_client } from "@cocalc/frontend/webapp-client" ;
16
13
import { CompressedPatch } from "@cocalc/sync/editor/generic/types" ;
17
14
import { callback2 } from "@cocalc/util/async-utils" ;
18
15
import { Config as FormatterConfig } from "@cocalc/util/code-formatter" ;
19
- import { type UserSearchResult as User } from "@cocalc/util/db-schema/accounts" ;
20
16
import { FakeSyncstring } from "./syncstring-fake" ;
17
+ import { type UserSearchResult as User } from "@cocalc/util/db-schema/accounts" ;
21
18
export { type User } ;
19
+ import { excludeFromComputeServer } from "@cocalc/frontend/file-associations" ;
22
20
23
21
import type { ExecOpts , ExecOutput } from "@cocalc/util/db-schema/projects" ;
24
22
export type { ExecOpts , ExecOutput } ;
@@ -27,40 +25,6 @@ import * as schema from "@cocalc/util/schema";
27
25
28
26
import { DEFAULT_FONT_SIZE } from "@cocalc/util/db-schema" ;
29
27
30
- // Track which projects have already shown the restart dialog
31
- const shownRestartDialogs = new Set < string > ( ) ;
32
-
33
- export function showProjectRestartDialog ( project_id : string ) : void {
34
- // Only show the dialog once per project
35
- if ( shownRestartDialogs . has ( project_id ) ) {
36
- return ;
37
- }
38
-
39
- shownRestartDialogs . add ( project_id ) ;
40
-
41
- const actions = redux . getActions ( "projects" ) ;
42
-
43
- Modal . confirm ( {
44
- title : "Project Needs Update" ,
45
- content : `This project needs to be restarted to support the new streaming compilation feature.
46
- Your work is automatically saved and will not be lost.` ,
47
- okText : "Restart Project" ,
48
- cancelText : "Not Now" ,
49
- width : 500 ,
50
- onOk : ( ) => {
51
- if ( actions ) {
52
- actions . restart_project ( project_id ) ;
53
- }
54
- // Clear the tracking when user clicks OK
55
- shownRestartDialogs . delete ( project_id ) ;
56
- } ,
57
- onCancel : ( ) => {
58
- // Clear the tracking when user dismisses the dialog
59
- shownRestartDialogs . delete ( project_id ) ;
60
- } ,
61
- } ) ;
62
- }
63
-
64
28
export function server_time ( ) : Date {
65
29
return webapp_client . time_client . server_time ( ) ;
66
30
}
0 commit comments