Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mastodon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pierre Boudes
mastodon
Commits
a5c6c748
Commit
a5c6c748
authored
7 years ago
by
ThibG
Committed by
Eugen Rochko
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Cancel outdated pending compose suggestions (#6838)
parent
36b57037
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/javascript/mastodon/actions/compose.js
+12
-0
12 additions, 0 deletions
app/javascript/mastodon/actions/compose.js
with
12 additions
and
0 deletions
app/javascript/mastodon/actions/compose.js
+
12
−
0
View file @
a5c6c748
import
api
from
'
../api
'
;
import
{
CancelToken
}
from
'
axios
'
;
import
{
throttle
}
from
'
lodash
'
;
import
{
search
as
emojiSearch
}
from
'
../features/emoji/emoji_mart_search_light
'
;
import
{
tagHistory
}
from
'
../settings
'
;
...
...
@@ -11,6 +12,8 @@ import {
refreshPublicTimeline
,
}
from
'
./timelines
'
;
let
cancelFetchComposeSuggestionsAccounts
;
export
const
COMPOSE_CHANGE
=
'
COMPOSE_CHANGE
'
;
export
const
COMPOSE_SUBMIT_REQUEST
=
'
COMPOSE_SUBMIT_REQUEST
'
;
export
const
COMPOSE_SUBMIT_SUCCESS
=
'
COMPOSE_SUBMIT_SUCCESS
'
;
...
...
@@ -257,13 +260,22 @@ export function undoUploadCompose(media_id) {
};
export
function
clearComposeSuggestions
()
{
if
(
cancelFetchComposeSuggestionsAccounts
)
{
cancelFetchComposeSuggestionsAccounts
();
}
return
{
type
:
COMPOSE_SUGGESTIONS_CLEAR
,
};
};
const
fetchComposeSuggestionsAccounts
=
throttle
((
dispatch
,
getState
,
token
)
=>
{
if
(
cancelFetchComposeSuggestionsAccounts
)
{
cancelFetchComposeSuggestionsAccounts
();
}
api
(
getState
).
get
(
'
/api/v1/accounts/search
'
,
{
cancelToken
:
new
CancelToken
(
cancel
=>
{
cancelFetchComposeSuggestionsAccounts
=
cancel
;
}),
params
:
{
q
:
token
.
slice
(
1
),
resolve
:
false
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment