Skip to content
代码片段 群组 项目
提交 2945775a 编辑于 作者: Timotej Ecimovic's avatar Timotej Ecimovic
浏览文件

Fix the file->open.

上级 9881b7f8
No related branches found
No related tags found
无相关合并请求
......@@ -43,8 +43,9 @@ const template = (db, httpPort) => [
label: 'Open File...',
accelerator: 'CmdOrCtrl+O',
db: db,
httpPort: httpPort,
click(menuItem, browserWindow, event) {
doOpen(menuItem.db)
doOpen(menuItem.db, menuItem.httpPort)
},
},
{
......@@ -183,7 +184,7 @@ async function getUserSessionInfoMessage(db, browserWindow) {
* @param {*} browserWindow
* @param {*} event
*/
function doOpen(db) {
function doOpen(db, httpPort) {
queryGeneric
.selectFileLocation(db, dbEnum.fileLocationCategory.save)
.then((filePath) => {
......@@ -197,7 +198,7 @@ function doOpen(db) {
})
.then((result) => {
if (!result.canceled) {
fileOpen(result.filePaths)
fileOpen(result.filePaths, httpPort)
}
})
.catch((err) => uiJs.showErrorMessage('Open file', err))
......@@ -279,7 +280,7 @@ function fileSave(browserWindow, filePath) {
* @param {*} db
* @param {*} filePaths
*/
function fileOpen(filePaths) {
function fileOpen(filePaths, httpPort) {
filePaths.forEach((filePath, index) => {
uiJs.openFileConfiguration(filePath, httpPort)
})
......
......@@ -87,13 +87,11 @@ function windowCreate(port, args = {}) {
let queryString = createQueryString(args.uiMode, args.embeddedMode)
w.isDirty = false
w.loadURL(`http://localhost:${port}/index.html` + queryString).then(
async () => {
if (args.filePath != null) {
browserApi.executeLoad(w, args.filePath)
}
w.loadURL(`http://localhost:${port}/` + queryString).then(async () => {
if (args.filePath != null) {
browserApi.executeLoad(w, args.filePath)
}
)
})
w.on('page-title-updated', (e) => {
e.preventDefault()
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册