Skip to content

Commit

Permalink
Removing orientation change
Browse files Browse the repository at this point in the history
  • Loading branch information
graphefruit committed May 3, 2024
1 parent 9c0b995 commit 7328f26
Show file tree
Hide file tree
Showing 3 changed files with 1,820 additions and 1,904 deletions.
38 changes: 0 additions & 38 deletions src/app/brew/brew-detail/brew-detail.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,23 +217,6 @@ export class BrewDetailComponent implements OnInit {
}

public async maximizeFlowGraph() {
let actualOrientation;
try {
if (this.platform.is('cordova')) {
actualOrientation = this.screenOrientation.type;
}
} catch (ex) {}
await new Promise(async (resolve) => {
try {
if (this.platform.is('cordova')) {
await this.screenOrientation.lock(
this.screenOrientation.ORIENTATIONS.LANDSCAPE
);
}
} catch (ex) {}
resolve(undefined);
});

const modal = await this.modalController.create({
component: BrewFlowComponent,
id: BrewFlowComponent.COMPONENT_ID,
Expand All @@ -250,27 +233,6 @@ export class BrewDetailComponent implements OnInit {
this.maximizeFlowGraphIsShown = false;
// If responsive would be true, the add of the container would result into 0 width 0 height, therefore the hack
try {
if (this.platform.is('cordova')) {
if (
this.screenOrientation.type ===
this.screenOrientation.ORIENTATIONS.LANDSCAPE
) {
if (
this.screenOrientation.ORIENTATIONS.LANDSCAPE ===
actualOrientation
) {
// Get back to portrait
setTimeout(async () => {
await this.screenOrientation.lock(
this.screenOrientation.ORIENTATIONS.PORTRAIT_PRIMARY
);
}, 50);
}
}
setTimeout(() => {
this.screenOrientation.unlock();
}, 150);
}
setTimeout(() => {
this.brewBrewingGraphEl.onOrientationChange();
}, 150);
Expand Down
Loading

0 comments on commit 7328f26

Please sign in to comment.