Skip to content

Commit

Permalink
fix: remove emulators when resetting config #3034
Browse files Browse the repository at this point in the history
  • Loading branch information
Julusian committed Sep 16, 2024
1 parent 7e90456 commit db5b787
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions companion/lib/Surface/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -1352,13 +1352,17 @@ class SurfaceController extends CoreBase {
this.#surfaceGroups.clear()

// Re-attach in auto-groups
for (const surface of this.#surfaceHandlers.values()) {
for (const [id, surface] of this.#surfaceHandlers.entries()) {
if (!surface) continue

try {
surface.resetConfig()
if (id.startsWith('emulator:')) {
this.removeDevice(id, true)
} else {
surface.resetConfig()

this.#attachSurfaceToGroup(surface)
this.#attachSurfaceToGroup(surface)
}
} catch (e) {
this.logger.warn('Could not reattach a surface')
}
Expand Down

0 comments on commit db5b787

Please sign in to comment.