Skip to content

Commit c2a0b88

Browse files
martinkaintasCedrikNikita
authored andcommitted
feat: lock screen orientation in portrait
1 parent adf6f4f commit c2a0b88

File tree

5 files changed

+55
-0
lines changed

5 files changed

+55
-0
lines changed

ios/App/Podfile

+2
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ def capacitor_pods
1717
pod 'CapacitorClipboard', :path => '../../node_modules/@capacitor/clipboard'
1818
pod 'CapacitorHaptics', :path => '../../node_modules/@capacitor/haptics'
1919
pod 'CapacitorKeyboard', :path => '../../node_modules/@capacitor/keyboard'
20+
pod 'CapacitorNetwork', :path => '../../node_modules/@capacitor/network'
2021
pod 'CapacitorShare', :path => '../../node_modules/@capacitor/share'
2122
pod 'CapacitorSplashScreen', :path => '../../node_modules/@capacitor/splash-screen'
2223
pod 'CapacitorStatusBar', :path => '../../node_modules/@capacitor/status-bar'
24+
pod 'CordovaPlugins', :path => '../capacitor-cordova-ios-plugins'
2325
end
2426

2527
target 'App' do

package-lock.json

+43
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"@aeternity/bip39": "^0.1.0",
3434
"@aeternity/hd-wallet": "^0.2.0",
3535
"@aeternity/json-bigint": "^0.3.1",
36+
"@awesome-cordova-plugins/screen-orientation": "^6.4.0",
3637
"@bitcoin-js/tiny-secp256k1-asmjs": "^2.2.3",
3738
"@capacitor-community/barcode-scanner": "^4.0.1",
3839
"@capacitor/android": "5.0.4",
@@ -65,6 +66,7 @@
6566
"bip32": "^4.0.0",
6667
"bitcoinjs-lib": "^6.1.3",
6768
"camelcase-keys-deep": "^0.1.0",
69+
"cordova-plugin-screen-orientation": "^3.0.3",
6870
"dayjs": "^1.11.9",
6971
"detect-browser": "^5.3.0",
7072
"ecpair": "^2.1.0",

src/popup/popup.ts

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import '@/lib/initPolyfills';
22
import '@/protocols/registerAdapters';
33
import { createApp } from 'vue';
44
import { IonicVue } from '@ionic/vue';
5+
import { IS_MOBILE_APP } from '@/constants';
56
import store from '../store';
67
import router from './router';
78
import { i18n } from '../store/plugins/languages';
@@ -12,6 +13,10 @@ import LoaderComponent from './components/Loader.vue';
1213

1314
import '../styles/fullscreen-message.scss';
1415

16+
if (IS_MOBILE_APP) {
17+
window.screen.orientation?.lock('portrait');
18+
}
19+
1520
registerModals();
1621
const app = createApp(App);
1722
app.use(IonicVue);

window.d.ts

+3
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,7 @@ declare global {
66
interface Window {
77
popupProps?: Partial<IPopupConfig>
88
}
9+
interface ScreenOrientation {
10+
lock: (orientation: 'portrait' | 'landscape' | 'portrait-primary' | 'portrait-secondary' | 'landscape-primary' | 'landscape-secondary' | 'any') => Promise<void>
11+
}
912
}

0 commit comments

Comments
 (0)