mirror of
https://github.com/towfiqi/serpbear
synced 2025-06-26 18:15:54 +00:00
FixUnrankedAgainIssues2 - Solve wrong position is shown when a result goes unranked again
This commit is contained in:
@@ -72,14 +72,13 @@ export const updateKeywordPosition = async (keywordRaw:Keyword, udpatedkeyword:
|
||||
|
||||
if (udpatedkeyword && keyword) {
|
||||
const newPos = udpatedkeyword.position;
|
||||
const newPosition = newPos !== 0 ? newPos : keyword.position;
|
||||
const { history } = keyword;
|
||||
const theDate = new Date();
|
||||
const dateKey = `${theDate.getFullYear()}-${theDate.getMonth() + 1}-${theDate.getDate()}`;
|
||||
history[dateKey] = newPosition;
|
||||
history[dateKey] = newPos;
|
||||
|
||||
const updatedVal = {
|
||||
position: newPosition,
|
||||
position: newPos,
|
||||
updating: false,
|
||||
url: udpatedkeyword.url,
|
||||
lastResult: udpatedkeyword.result,
|
||||
|
||||
Reference in New Issue
Block a user