mirror of
https://github.com/suitenumerique/meet.git
synced 2026-09-03 14:17:59 +00:00
wip propose back a no effect options to help user deactivate their effect
This commit is contained in:
+34
-1
@@ -25,7 +25,11 @@ import {
|
|||||||
} from '@/features/files/api/listFiles.ts'
|
} from '@/features/files/api/listFiles.ts'
|
||||||
import { useCreateFile } from '@/features/files/api/createFile.ts'
|
import { useCreateFile } from '@/features/files/api/createFile.ts'
|
||||||
import { FileTrigger } from 'react-aria-components'
|
import { FileTrigger } from 'react-aria-components'
|
||||||
import { RiDeleteBinLine, RiImageAddFill } from '@remixicon/react'
|
import {
|
||||||
|
RiDeleteBinLine,
|
||||||
|
RiImageAddFill,
|
||||||
|
RiProhibitedLine,
|
||||||
|
} from '@remixicon/react'
|
||||||
import { useDeleteFile } from '@/features/files/api/deleteFile.ts'
|
import { useDeleteFile } from '@/features/files/api/deleteFile.ts'
|
||||||
import { useUser } from '@/features/auth/api/useUser'
|
import { useUser } from '@/features/auth/api/useUser'
|
||||||
import { ApiFileItem } from '@/features/files/api/types.ts'
|
import { ApiFileItem } from '@/features/files/api/types.ts'
|
||||||
@@ -250,6 +254,24 @@ export const EffectsConfiguration = ({
|
|||||||
[enabled, selectedId, toggle, updateEffectStatusMessage, videoTrack]
|
[enabled, selectedId, toggle, updateEffectStatusMessage, videoTrack]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const clearEffect = useCallback(async () => {
|
||||||
|
if (selectedId === 'none') return
|
||||||
|
setProcessorPending(true)
|
||||||
|
try {
|
||||||
|
if (videoTrack?.getProcessor()) {
|
||||||
|
await videoTrack.stopProcessor()
|
||||||
|
}
|
||||||
|
saveProcessorConfig(undefined)
|
||||||
|
announceEffectStatusMessage(t('blur.status.none'))
|
||||||
|
} catch (error) {
|
||||||
|
reportError('effects_processor_failure', error, {
|
||||||
|
context: 'Error clearing effect:',
|
||||||
|
})
|
||||||
|
} finally {
|
||||||
|
setTimeout(() => setProcessorPending(false))
|
||||||
|
}
|
||||||
|
}, [announceEffectStatusMessage, selectedId, t, videoTrack])
|
||||||
|
|
||||||
const { data: appConfig } = useConfig()
|
const { data: appConfig } = useConfig()
|
||||||
const { isLoggedIn } = useUser()
|
const { isLoggedIn } = useUser()
|
||||||
const canUploadBackground =
|
const canUploadBackground =
|
||||||
@@ -647,6 +669,17 @@ export const EffectsConfiguration = ({
|
|||||||
gap: '1.25rem',
|
gap: '1.25rem',
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
|
<ToggleButton
|
||||||
|
variant="bigSquare"
|
||||||
|
aria-label={t('clear')}
|
||||||
|
tooltip={t('clear')}
|
||||||
|
isDisabled={processorOptions.isDisabled}
|
||||||
|
onChange={clearEffect}
|
||||||
|
isSelected={selectedId === 'none'}
|
||||||
|
data-attr="toggle-effect-none"
|
||||||
|
>
|
||||||
|
<RiProhibitedLine />
|
||||||
|
</ToggleButton>
|
||||||
{processorOptions.blurBased.map(({ Icon, ...option }) => (
|
{processorOptions.blurBased.map(({ Icon, ...option }) => (
|
||||||
<ToggleButton
|
<ToggleButton
|
||||||
key={option.id}
|
key={option.id}
|
||||||
|
|||||||
Reference in New Issue
Block a user