Compare commits

..

No commits in common. "920ae2367fdb5350778a0f91889acc35fe67b6ba" and "a1fcb1cfb84fd6b36c8fe9fd56588119fa4377bc" have entirely different histories.

2 changed files with 8 additions and 15 deletions

View File

@ -10,7 +10,6 @@ import (
"code.gitea.io/gitea/models/db" "code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/modules/cache" "code.gitea.io/gitea/modules/cache"
setting_module "code.gitea.io/gitea/modules/setting"
"xorm.io/builder" "xorm.io/builder"
) )
@ -155,16 +154,11 @@ func SetUserSetting(userID int64, key, value string) error {
return err return err
} }
if err := upsertUserSettingValue(userID, key, value); err != nil { _, err := cache.GetString(genSettingCacheKey(userID, key), func() (string, error) {
return err return value, upsertUserSettingValue(userID, key, value)
} })
cc := cache.GetCache() return err
if cc != nil {
return cc.Put(genSettingCacheKey(userID, key), value, setting_module.CacheService.TTLSeconds())
}
return nil
} }
func upsertUserSettingValue(userID int64, key, value string) error { func upsertUserSettingValue(userID int64, key, value string) error {

View File

@ -7,7 +7,6 @@ import {showGlobalErrorMessage} from '../bootstrap.js';
import {attachDropdownAria} from './aria.js'; import {attachDropdownAria} from './aria.js';
import {handleGlobalEnterQuickSubmit} from './comp/QuickSubmit.js'; import {handleGlobalEnterQuickSubmit} from './comp/QuickSubmit.js';
import {initTooltip} from '../modules/tippy.js'; import {initTooltip} from '../modules/tippy.js';
import {svg} from '../svg.js';
const {appUrl, csrfToken} = window.config; const {appUrl, csrfToken} = window.config;
@ -170,10 +169,10 @@ export function initGlobalDropzone() {
$dropzone.find('.files').append(input); $dropzone.find('.files').append(input);
// Create a "Copy Link" element, to conveniently copy the image // Create a "Copy Link" element, to conveniently copy the image
// or file link as Markdown to the clipboard // or file link as Markdown to the clipboard
const copyLinkElement = document.createElement('div'); const copyLinkElement = document.createElement('a');
copyLinkElement.className = 'tc'; copyLinkElement.className = 'dz-remove';
// The a element has a hardcoded cursor: pointer because the default is overridden by .dropzone copyLinkElement.href = '#';
copyLinkElement.innerHTML = `<a href="#" style="cursor: pointer;">${svg('octicon-copy', 14, 'copy link')} Copy link</a>`; copyLinkElement.innerHTML = '<i class="fa fa-copy"></i> Copy link';
copyLinkElement.addEventListener('click', (e) => { copyLinkElement.addEventListener('click', (e) => {
e.preventDefault(); e.preventDefault();
let fileMarkdown = `[${file.name}](/attachments/${file.uuid})`; let fileMarkdown = `[${file.name}](/attachments/${file.uuid})`;