Skip to content

Commit 2349b50

Browse files
committed
Merge pull request #10 from OpenframeProject/frame-update
Remove plugin install/init on frame update for now
2 parents 8ab6448 + 5696fcc commit 2349b50

File tree

2 files changed

+36
-23
lines changed

2 files changed

+36
-23
lines changed

src/controller.js

Lines changed: 35 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -345,28 +345,41 @@ fc.updateFrame = function() {
345345
// fetch the latest frame state, and update as needed
346346
frame.fetch()
347347
.then(function(new_state) {
348-
pm.installPlugins(new_state.plugins)
349-
.then(function() {
350-
debug('-----> plugins installed');
351-
pm.initPlugins(frame.state.plugins, fc.pluginApi)
352-
.then(function() {
353-
// once we're done updating/initializing the frame plugins, call change artwork
354-
// TODO: we could add logic here to only update necessary items...
355-
// For now, changeArtwork should exit if old and new artwork are the same
356-
// TODO: DRY with else below
357-
if (frame.state._current_artwork) {
358-
fc.changeArtwork()
359-
.then(function() {
360-
// success changing artwork
361-
})
362-
.catch(function() {
363-
// error changing artwork, reset frame.state._current_artwork to true current
364-
frame.state._current_artwork = fc.current_artwork;
365-
});
366-
}
367-
});
368-
})
369-
.catch(debug);
348+
if (frame.state._current_artwork) {
349+
fc.changeArtwork()
350+
.then(function() {
351+
// success changing artwork
352+
})
353+
.catch(function() {
354+
// error changing artwork, reset frame.state._current_artwork to true current
355+
frame.state._current_artwork = fc.current_artwork;
356+
});
357+
}
358+
// Until we get the base extension module ready, which will handle init status,
359+
// don't install/init plugins on frame update
360+
//
361+
// pm.installPlugins(new_state.plugins)
362+
// .then(function() {
363+
// debug('-----> plugins installed');
364+
// pm.initPlugins(frame.state.plugins, fc.pluginApi)
365+
// .then(function() {
366+
// // once we're done updating/initializing the frame plugins, call change artwork
367+
// // TODO: we could add logic here to only update necessary items...
368+
// // For now, changeArtwork should exit if old and new artwork are the same
369+
// // TODO: DRY with else below
370+
// if (frame.state._current_artwork) {
371+
// fc.changeArtwork()
372+
// .then(function() {
373+
// // success changing artwork
374+
// })
375+
// .catch(function() {
376+
// // error changing artwork, reset frame.state._current_artwork to true current
377+
// frame.state._current_artwork = fc.current_artwork;
378+
// });
379+
// }
380+
// });
381+
// })
382+
// .catch(debug);
370383
});
371384
};
372385

src/plugin-manager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pm.installPlugins = function(plugins, force) {
3434
key,
3535
_force = force === true ? true : false;
3636

37-
// add each plugin to package.json
37+
// install each plugin
3838
for (key in plugins) {
3939
if (plugins.hasOwnProperty(key)) {
4040
promises.push(_installPlugin(key, plugins[key], _force));

0 commit comments

Comments
 (0)