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/modules/cache"
setting_module "code.gitea.io/gitea/modules/setting"
"xorm.io/builder"
)
@ -155,18 +154,13 @@ func SetUserSetting(userID int64, key, value string) error {
return err
}
if err := upsertUserSettingValue(userID, key, value); err != nil {
_, err := cache.GetString(genSettingCacheKey(userID, key), func() (string, error) {
return value, upsertUserSettingValue(userID, key, value)
})
return err
}
cc := cache.GetCache()
if cc != nil {
return cc.Put(genSettingCacheKey(userID, key), value, setting_module.CacheService.TTLSeconds())
}
return nil
}
func upsertUserSettingValue(userID int64, key, value string) error {
return db.WithTx(db.DefaultContext, func(ctx context.Context) error {
e := db.GetEngine(ctx)

View File

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