Skip to content

Commit

Permalink
Merge pull request #13658 from nextcloud/fix/macos-hotkeys
Browse files Browse the repository at this point in the history
fix(chat): Edit last message hotkey on macOS
  • Loading branch information
ShGKme authored Nov 1, 2024
2 parents 3b46d05 + a8e04e7 commit 5c10a88
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 10 deletions.
14 changes: 14 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
"@nextcloud/stylelint-config": "^3.0.1",
"@nextcloud/webpack-vue-config": "^6.2.0",
"@types/jest": "^29.5.14",
"@types/ua-parser-js": "^0.7.39",
"@vue/test-utils": "^1.3.6",
"@vue/tsconfig": "^0.5.1",
"@vue/vue2-jest": "^29.2.6",
Expand Down
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import { leaveConversationSync } from './services/participantsService.js'
import { useCallViewStore } from './stores/callView.js'
import { useFederationStore } from './stores/federation.ts'
import { useSidebarStore } from './stores/sidebar.js'
import { checkBrowser } from './utils/browserCheck.js'
import { checkBrowser } from './utils/browserCheck.ts'
import { signalingKill } from './utils/webrtc/index.js'
export default {
Expand Down
2 changes: 1 addition & 1 deletion src/FilesSidebarTabApp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import { getFileConversation } from './services/filesIntegrationServices.js'
import {
leaveConversationSync,
} from './services/participantsService.js'
import { checkBrowser } from './utils/browserCheck.js'
import { checkBrowser } from './utils/browserCheck.ts'
import CancelableRequest from './utils/cancelableRequest.js'
import { signalingKill } from './utils/webrtc/index.js'
Expand Down
2 changes: 1 addition & 1 deletion src/PublicShareAuthRequestPasswordButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { t } from '@nextcloud/l10n'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import { getPublicShareAuthConversationToken } from './services/publicShareAuthService.js'
import { checkBrowser } from './utils/browserCheck.js'
import { checkBrowser } from './utils/browserCheck.ts'
export default {
Expand Down
2 changes: 1 addition & 1 deletion src/PublicShareSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ import { getPublicShareConversationData } from './services/filesIntegrationServi
import {
leaveConversationSync,
} from './services/participantsService.js'
import { checkBrowser } from './utils/browserCheck.js'
import { checkBrowser } from './utils/browserCheck.ts'
import { signalingKill } from './utils/webrtc/index.js'
export default {
Expand Down
1 change: 1 addition & 0 deletions src/components/NewMessage/NewMessage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
dir="auto"
@keydown.esc="handleInputEsc"
@keydown.ctrl.up="handleEditLastMessage"
@keydown.meta.up="handleEditLastMessage"
@input="handleTyping"
@paste="handlePastedFiles"
@submit="handleSubmit" />
Expand Down
7 changes: 5 additions & 2 deletions src/components/SettingsDialog/SettingsDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
</dd>
</div>
<div>
<dt><kbd>Ctrl</kbd> + <kbd>↑</kbd></dt>
<dt><kbd>{{ CmdOrCtrl }}</kbd> + <kbd>↑</kbd></dt>
<dd class="shortcut-description">
{{ t('spreed', 'Edit your last message') }}
</dd>
Expand All @@ -156,7 +156,7 @@
</dd>
</div>
<div>
<dt><kbd>Ctrl</kbd> + <kbd>F</kbd></dt>
<dt><kbd>{{ CmdOrCtrl }}</kbd> + <kbd>F</kbd></dt>
<dd class="shortcut-description">
{{ t('spreed', 'Search') }}
</dd>
Expand Down Expand Up @@ -219,6 +219,7 @@ import { useCustomSettings } from '../../services/SettingsAPI.ts'
import { setUserConfig } from '../../services/settingsService.js'
import { useSettingsStore } from '../../stores/settings.js'
import { useSoundsStore } from '../../stores/sounds.js'
import { isMac } from '../../utils/browserCheck.ts'
import { satisfyVersion } from '../../utils/satisfyVersion.ts'
const serverVersion = loadState('core', 'config', {}).version ?? '29.0.0.0'
Expand Down Expand Up @@ -246,8 +247,10 @@ export default {
const soundsStore = useSoundsStore()
const { customSettingsSections } = useCustomSettings()
const isBackgroundBlurred = ref(isBackgroundBlurredState)
const CmdOrCtrl = isMac ? 'Cmd' : 'Ctrl'
return {
CmdOrCtrl,
settingsStore,
soundsStore,
supportTypingStatus,
Expand Down
2 changes: 1 addition & 1 deletion src/components/TopBar/CallButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ import { useCallViewStore } from '../../stores/callView.js'
import { useSettingsStore } from '../../stores/settings.js'
import { useSoundsStore } from '../../stores/sounds.js'
import { useTalkHashStore } from '../../stores/talkHash.js'
import { blockCalls, unsupportedWarning } from '../../utils/browserCheck.js'
import { blockCalls, unsupportedWarning } from '../../utils/browserCheck.ts'
export default {
name: 'CallButton',
Expand Down
7 changes: 7 additions & 0 deletions src/utils/browserCheck.js → src/utils/browserCheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ import { t } from '@nextcloud/l10n'

const parser = new UAParser()
const browser = parser.getBrowser()
const os = parser.getOS()

/**
* Per-OS flags
*/

export const isMac = os.name === 'Mac OS'

/**
* Per-browser flags and a major version
Expand Down
2 changes: 1 addition & 1 deletion src/utils/media/pipeline/MediaDevicesSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

import TrackSource from './TrackSource.js'
import { isChromium } from '../../browserCheck.js'
import { isChromium } from '../../browserCheck.ts'
import { mediaDevicesManager } from '../../webrtc/index.js'

/**
Expand Down
2 changes: 1 addition & 1 deletion src/utils/webrtc/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import BrowserStorage from '../../services/BrowserStorage.js'
import { getTalkConfig } from '../../services/CapabilitiesManager.ts'
import { fetchSignalingSettings } from '../../services/signalingService.js'
import store from '../../store/index.js'
import { isSafari } from '../browserCheck.js'
import { isSafari } from '../browserCheck.ts'
import CancelableRequest from '../cancelableRequest.js'
import Signaling from '../signaling.js'
import SignalingTypingHandler from '../SignalingTypingHandler.js'
Expand Down
2 changes: 1 addition & 1 deletion src/utils/webrtc/simplewebrtc/peer.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import adapter from 'webrtc-adapter'
import webrtcSupport from 'webrtcsupport'
import WildEmitter from 'wildemitter'

import { isSafari } from '../../../utils/browserCheck.js'
import { isSafari } from '../../browserCheck.ts'

/**
* @param {object} stream the stream object.
Expand Down

0 comments on commit 5c10a88

Please sign in to comment.