Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
filip131311 committed Dec 20, 2024
1 parent 70b8723 commit 70e7a33
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
22 changes: 13 additions & 9 deletions packages/vscode-extension/src/project/deviceSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,17 +316,21 @@ export class DeviceSession implements Disposable {
}

public async changeDeviceSettings(settings: DeviceSettings): Promise<boolean> {
this.deviceSettings = settings;
if (settings.replaysEnabled && !this.isLaunching) {
this.device.enableReplay();
} else {
this.device.disableReplays();
if (this.deviceSettings?.replaysEnabled !== settings.replaysEnabled) {
if (settings.replaysEnabled && !this.isLaunching) {
this.device.enableReplay();
} else {
this.device.disableReplays();
}
}
if (settings.showTouches && !this.isLaunching) {
this.device.showTouches();
} else {
this.device.hideTouches();
if (this.deviceSettings?.showTouches !== settings.showTouches) {
if (settings.showTouches && !this.isLaunching) {
this.device.showTouches();
} else {
this.device.hideTouches();
}
}
this.deviceSettings = settings;
return this.device.changeSettings(settings);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function DeviceSettingsDropdown({ children, disabled }: DeviceSettingsDropdownPr
defaultValue={[contentSizes.indexOf(deviceSettings.contentSize)]}
max={6}
step={1}
onValueChange={([value]) => {
onValueCommit={([value]) => {
project.updateDeviceSettings({
...deviceSettings,
contentSize: contentSizes[value],
Expand Down

0 comments on commit 70e7a33

Please sign in to comment.