Compare commits

..

3 Commits

Author SHA1 Message Date
Ajay Bura
a6fdf9010b v2.0.2 2022-05-14 09:38:58 +05:30
Ajay Bura
941dae0625 Remove globally exposed var 2022-05-14 08:28:31 +05:30
Ajay Bura
4a715bfd17 Fix pasting not working #551 2022-05-14 08:24:21 +05:30
5 changed files with 15 additions and 10 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "cinny",
"version": "2.0.1",
"version": "2.0.2",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "cinny",
"version": "2.0.1",
"version": "2.0.2",
"license": "MIT",
"dependencies": {
"@fontsource/inter": "^4.5.10",

View File

@@ -1,6 +1,6 @@
{
"name": "cinny",
"version": "2.0.1",
"version": "2.0.2",
"description": "Yet another matrix client",
"main": "index.js",
"engines": {

View File

@@ -33,22 +33,22 @@ function listenKeyboard(event) {
// open search modal
if (event.code === 'KeyK') {
event.preventDefault();
if (navigation.isRawModalVisible) {
return;
}
if (navigation.isRawModalVisible) return;
openSearch();
}
// focus message field on paste
if (event.code === 'KeyV') {
if (navigation.isRawModalVisible) return;
const msgTextarea = document.getElementById('message-textarea');
if (document.activeElement !== msgTextarea && document.activeElement.tagName.toLowerCase() === 'input') return;
msgTextarea?.focus();
}
}
if (!event.ctrlKey && !event.altKey && !event.metaKey) {
if (navigation.isRawModalVisible) return;
if (['text', 'textarea'].includes(document.activeElement.type)) {
if (document.activeElement.tagName.toLowerCase() === 'input') {
return;
}

View File

@@ -1,5 +1,5 @@
const cons = {
version: '2.0.1',
version: '2.0.2',
secretKey: {
ACCESS_TOKEN: 'cinny_access_token',
DEVICE_ID: 'cinny_device_id',

View File

@@ -14,7 +14,7 @@ class Navigation extends EventEmitter {
this.isRoomSettings = false;
this.recentRooms = [];
this.isRawModalVisible = false;
this.rawModelStack = [];
}
_setSpacePath(roomId) {
@@ -47,8 +47,13 @@ class Navigation extends EventEmitter {
}
}
get isRawModalVisible() {
return this.rawModelStack.length > 0;
}
setIsRawModalVisible(visible) {
this.isRawModalVisible = visible;
if (visible) this.rawModelStack.push(true);
else this.rawModelStack.pop();
}
navigate(action) {