33 lines
583 B
TypeScript
33 lines
583 B
TypeScript
import { addActionHandler } from '../../index';
|
|
|
|
addActionHandler('setStickerSearchQuery', (global, actions, payload) => {
|
|
const { query } = payload!;
|
|
|
|
return {
|
|
...global,
|
|
stickers: {
|
|
...global.stickers,
|
|
search: {
|
|
query,
|
|
resultIds: undefined,
|
|
},
|
|
},
|
|
};
|
|
});
|
|
|
|
addActionHandler('setGifSearchQuery', (global, actions, payload) => {
|
|
const { query } = payload!;
|
|
|
|
return {
|
|
...global,
|
|
gifs: {
|
|
...global.gifs,
|
|
search: {
|
|
query,
|
|
offsetId: undefined,
|
|
results: undefined,
|
|
},
|
|
},
|
|
};
|
|
});
|