Skip to content

Commit

Permalink
use LABEL_DEFAULT_PRINTER user setting to pre-select plugin in label …
Browse files Browse the repository at this point in the history
…printing forms (#8330)
  • Loading branch information
simonkuehling authored Oct 23, 2024
1 parent a6bba14 commit 5ed0af2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/frontend/src/components/buttons/PrintingActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { extractAvailableFields } from '../../functions/forms';
import { useCreateApiFormModal } from '../../hooks/UseForm';
import { apiUrl } from '../../states/ApiState';
import { useLocalState } from '../../states/LocalState';
import { useUserSettingsState } from '../../states/SettingsState';
import { ApiFormFieldSet } from '../forms/fields/ApiFormField';
import { ActionDropdown } from '../items/ActionDropdown';

Expand All @@ -29,6 +30,8 @@ export function PrintingActions({
}) {
const { host } = useLocalState.getState();

const userSettings = useUserSettingsState();

const enabled = useMemo(() => items.length > 0, [items]);

const [pluginKey, setPluginKey] = useState<string>('');
Expand Down Expand Up @@ -74,6 +77,7 @@ export function PrintingActions({

fields['plugin'] = {
...fields['plugin'],
value: userSettings.getSetting('LABEL_DEFAULT_PRINTER'),
filters: {
active: true,
mixin: 'labels'
Expand Down

0 comments on commit 5ed0af2

Please sign in to comment.