| 775 | } |
| 776 | }, |
| 777 | add_custom_button(state, custom_button){ |
| 778 | /** |
| 779 | * custom_button: CustomButton type object. |
| 780 | * **/ |
| 781 | |
| 782 | let custom_buttons = state.current['custom_buttons'] |
| 783 | if (!custom_buttons){ |
| 784 | custom_buttons = { |
| 785 | 'buttons_list': [custom_button] |
| 786 | } |
| 787 | } else{ |
| 788 | if(!custom_buttons.buttons_list){ |
| 789 | custom_buttons.buttons_list = [custom_button] |
| 790 | } else{ |
| 791 | custom_buttons.buttons_list.push(custom_button) |
| 792 | } |
| 793 | |
| 794 | } |
| 795 | state.current['custom_buttons'] = custom_buttons |
| 796 | state.current = {...state.current} |
| 797 | }, |
| 798 | |
| 799 | set_ui_schema_top_level_key_value(state, payload) { |
| 800 | state.current[payload[0]] = payload[1] |