File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
src/routes/page/knowledge-base/documents Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change 1818 uploadKnowledgeDocuments ,
1919 deleteKnowledgeDocument
2020 } from ' $lib/services/knowledge-base-service' ;
21+ import { isHtml } from ' $lib/helpers/utils/file' ;
2122
2223 const svelteDispatch = createEventDispatcher ();
2324
261262 const found = savedFiles .find ((_ , idx ) => idx === index);
262263 if (! found) return ;
263264
264- const url = isExternalUrl (found .file_url ) ?
265- found .file_url : ` ${ PUBLIC_SERVICE_URL }${ found .file_url } ?access_token=${ $userStore? .token }` ;
266-
267- window.open(url);
265+ let url = ' ' ;
266+ if (! isHtml (found .file_extension || found .file_name )) {
267+ if (found .file_url ) {
268+ url = isExternalUrl (found .file_url ) ? found .file_url : ` ${ PUBLIC_SERVICE_URL }${ found .file_url } ?access_token=${ $userStore? .token }` ;
269+ }
270+ } else {
271+ url = found.ref_data?.url;
272+ }
273+
274+ if (url) {
275+ window.open(url);
276+ }
268277 }
269278
270279 function reset() {
You can’t perform that action at this time.
0 commit comments