Cache extension metadata

This commit is contained in:
Kevin Sawicki 2016-06-07 16:10:27 -07:00
parent ea9d2dadf8
commit 2367cd574e

View file

@ -8,9 +8,13 @@ const {ipcRenderer} = require('electron')
const fs = require('fs')
const path = require('path')
let metadata
const getExtensionMetadata = () => {
// FIXME(kevinsawicki) Either cache this or don't use sync IPC to obtain it
return ipcRenderer.sendSync('CHROME_I18N_MANIFEST', chrome.runtime.id)
if (!metadata) {
metadata = ipcRenderer.sendSync('CHROME_I18N_MANIFEST', chrome.runtime.id)
}
return metadata
}
const getMessagesPath = (language) => {