Skip to content

Commit b3bd81d

Browse files
committed
feat: preview only recognised files
1 parent 3d22938 commit b3bd81d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/extensions/default/Phoenix/serverSync.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,13 @@ define(function (require, exports, module) {
205205
});
206206
}
207207

208-
function _isPreviewableFile(path) {
209-
return true;
208+
function _isPreviewableFile(filePath) {
209+
let pathSplit = filePath.split('.');
210+
let extension = pathSplit && pathSplit.length>1 ? pathSplit[pathSplit.length-1] : null;
211+
if(['html', 'htm', 'jpg', 'jpeg', 'png', 'svg', 'pdf', 'xml'].includes(extension.toLowerCase())){
212+
return true;
213+
}
214+
return false;
210215
}
211216

212217
function _loadPreview() {

0 commit comments

Comments
 (0)