diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index dcb5c57c..412fc9e2 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -1,7 +1,7 @@ class UserController < ApplicationController include ThemeHelper - before_action :authenticate_user!, only: %w(edit update edit_privacy update_privacy edit_theme update_theme preview_theme delete_theme data export begin_export edit_security update_2fa destroy_2fa reset_user_recovery_codes) + before_action :authenticate_user!, only: %w(edit update edit_privacy update_privacy edit_theme update_theme preview_theme delete_theme data export begin_export edit_security update_2fa destroy_2fa reset_user_recovery_codes edit_mute) def show @user = User.where('LOWER(screen_name) = ?', params[:username].downcase).includes(:profile).first! diff --git a/app/javascript/retrospring/features/settings/index.ts b/app/javascript/retrospring/features/settings/index.ts index 3aa64226..138d756c 100644 --- a/app/javascript/retrospring/features/settings/index.ts +++ b/app/javascript/retrospring/features/settings/index.ts @@ -2,7 +2,7 @@ import {createDeleteEvent, createSubmitEvent} from "retrospring/features/setting export default (): void => { const submit: HTMLButtonElement = document.getElementById('new-rule-submit') as HTMLButtonElement; - if (submit.classList.contains('js-initialized')) return; + if (!submit || submit.classList.contains('js-initialized')) return; const rulesList = document.querySelector('.js-rules-list'); rulesList.querySelectorAll('.form-group:not(.js-initalized)').forEach(entry => {