Skip to content

Commit 4d61652

Browse files
committed
remove signal stuff
1 parent b0c207a commit 4d61652

File tree

1 file changed

+1
-64
lines changed

1 file changed

+1
-64
lines changed

src/contents.ts

Lines changed: 1 addition & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ export class Drive implements Contents.IDrive {
3838
this._serverSettings = ServerConnection.makeSettings();
3939
this._name = options.name ?? '';
4040
this._drivesList = options.drivesList ?? [];
41-
42-
this.fileChanged.connect((sender, args) => {
43-
console.log('fileChanged', args);
44-
});
4541
}
4642

4743
/**
@@ -178,10 +174,6 @@ export class Drive implements Contents.IDrive {
178174
Signal.clearData(this);
179175
}
180176

181-
get loadingContents(): ISignal<this, LoadingContentsArgs> {
182-
return this._loadingContents;
183-
}
184-
185177
/**
186178
* Get an encoded download url given a file path.
187179
*
@@ -223,13 +215,9 @@ export class Drive implements Contents.IDrive {
223215
localPath: string,
224216
options?: Contents.IFetchOptions
225217
): Promise<Contents.IModel> {
226-
console.log('[DEBUG] get() called with localPath:', localPath);
227218
let data: Contents.IModel;
228219

229-
const isFromClick = this.isUserInitiated();
230-
231220
if (localPath !== '') {
232-
console.log('debug: IF get() called with localPath:', localPath);
233221
const currentDrive = extractCurrentDrive(localPath, this._drivesList);
234222

235223
// when accessed the first time, mount drive
@@ -251,14 +239,6 @@ export class Drive implements Contents.IDrive {
251239
registeredFileTypes: this._registeredFileTypes
252240
});
253241

254-
isFromClick &&
255-
this._loadingContents.emit({
256-
type: 'loading',
257-
path: localPath,
258-
driveName: this._name,
259-
itemType: result.isDir ? 'directory' : 'file'
260-
});
261-
262242
data = {
263243
name: result.isDir
264244
? currentPath
@@ -283,16 +263,6 @@ export class Drive implements Contents.IDrive {
283263
type: result.isDir ? 'directory' : result.type!
284264
};
285265
} else {
286-
console.log('debug: ELSE get() called with localPath:', localPath);
287-
288-
isFromClick &&
289-
this._loadingContents.emit({
290-
type: 'loading',
291-
path: localPath,
292-
driveName: this._name,
293-
itemType: 'directory'
294-
});
295-
296266
// retriving list of contents from root
297267
// in our case: list available drives
298268
const drivesListInfo: Contents.IModel[] = [];
@@ -335,34 +305,9 @@ export class Drive implements Contents.IDrive {
335305
}
336306

337307
Contents.validateContentsModel(data);
338-
339-
isFromClick &&
340-
this._loadingContents.emit({
341-
type: 'loaded',
342-
path: localPath,
343-
driveName: this._name,
344-
itemType: 'directory'
345-
});
346308
return data;
347309
}
348310

349-
// This is dumb?
350-
isUserInitiated() {
351-
const stack = new Error().stack;
352-
353-
// Check if it's from a click event by examining the call stack
354-
const isFromClick =
355-
stack?.includes('evtDblClick') ||
356-
stack?.includes('handleOpen') ||
357-
stack?.includes('_evtClick');
358-
359-
console.log('[DEBUG] Call stack analysis:');
360-
console.log(' - Is from click event:', isFromClick);
361-
console.log(' - Call stack:', stack?.split('\n').join('\n '));
362-
363-
return isFromClick;
364-
}
365-
366311
/**
367312
* Create a new untitled file or directory in the specified directory path.
368313
*
@@ -1107,16 +1052,8 @@ export class Drive implements Contents.IDrive {
11071052
private _isDisposed: boolean = false;
11081053
private _disposed = new Signal<this, void>(this);
11091054
private _registeredFileTypes: IRegisteredFileTypes = {};
1110-
private _loadingContents = new Signal<this, LoadingContentsArgs>(this);
11111055
}
11121056

1113-
type LoadingContentsArgs = {
1114-
type: 'loading' | 'loaded';
1115-
path: string;
1116-
driveName: string;
1117-
itemType: 'directory' | 'file';
1118-
};
1119-
11201057
export namespace Drive {
11211058
/**
11221059
* The options used to initialize a `Drive`.
@@ -1145,4 +1082,4 @@ export namespace Drive {
11451082
*/
11461083
apiEndpoint?: string;
11471084
}
1148-
}
1085+
}

0 commit comments

Comments
 (0)