Skip to content

Commit

Permalink
Show correct file path in gdocs addon
Browse files Browse the repository at this point in the history
  • Loading branch information
ggodlewski committed Dec 23, 2024
1 parent 6cf988c commit fd639cc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions apps/ui/src/components/ImportExportSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ export default {
reader.onload = readerEvent => {
const content = readerEvent.target.result; // this is the content!
resolve(content);
}
}
};
};
input.click();
});
Expand Down
7 changes: 6 additions & 1 deletion src/containers/server/routes/GoogleDriveController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {UserAuthClient} from '../../../google/AuthClient.ts';
import {filterParams} from '../../../google/driveFetch.ts';
import {GoogleDriveService} from '../../../google/GoogleDriveService.ts';
import {redirError} from '../auth.ts';
import {LocalLog} from '../../transform/LocalLog.ts';

export class GoogleDriveController extends Controller {

Expand Down Expand Up @@ -77,9 +78,13 @@ export class GoogleDriveController extends Controller {
const transformedFileSystem = await this.filesService.getSubFileService(driveId + '_transform', '');
const contentFileService = await getContentFileService(transformedFileSystem, userConfigService);

const localLog = new LocalLog(contentFileService);
await localLog.load();
const logRow = localLog.findLastFile(fileId);

const markdownTreeProcessor = new MarkdownTreeProcessor(contentFileService);
await markdownTreeProcessor.load();
const [foundTreeItem] = await markdownTreeProcessor.findById(fileId);
const [foundTreeItem] = await markdownTreeProcessor.findByPath(logRow.filePath);

const contentDir = (userConfigService.config.transform_subdir || '').startsWith('/') ? userConfigService.config.transform_subdir : undefined;
this.res.setHeader('wgd-content-dir', contentDir || '');
Expand Down

0 comments on commit fd639cc

Please sign in to comment.